In DN32, the content after 2. The Second Recitation Section is empty space.
Do you mean this space:
It’s just the entire previous text repeated.
Oh… Are you on FireFox? I think this is some odd browser bug. I think it’s been reported before. Maybe solved? Maybe it’s back?
yeah, that space shouldn’t be there.
I’m going to split this into its own thread since it’s a code problem, not a typo.
Yes, that space. I tried Safari and DuckDuckGo.
So are you on a Mac laptop/desktop? And you tested in Safari and DDG (which I believe is Chromium under the hood) and got the same result?
Could you let us know which version of Safari you are using?
Yes, a MacBook Pro laptop, Safari Version 17.6 (19618.3.11.11.5)
I tried Google Chrome also, same result.
Oh, yes, it looks that way for me on Chrome too.
My recollection was that this was a problem previously on just one browser, probably not Chrome. So maybe this is a new thing that’s spread.
@anon21813178 you have a great memory for these things. Does this ring a bell?
This might be intentional? I recall seeing something similar with long sidenotes in screenshots earlier in the bug thread, like in this post
I might be mistaken, but either you’d have some empty space or there could be some overlap and other misalignment. Out of those options the empty space is the only legible one
Oh nevermind, I see the second screenshot is just English and no side-by-side - yea that doesn’t seem right. I can reproduce that on Chrome 143.0.7499.192 for Android and Chrome Version 143.0.7499.194 (Official Build) (x86_64) on macOS
Quite literally empty <span>s in the inspector:
When I disable the margin-left: 2em on the .verse-line .translation CSS, it’s fixed:
So that line of CSS might need to be conditional or something - would need to look at the code more closely (here’s the line of CSS for reference), but figure I’d give a first pass look on it while I’m here.
Thanks for that diagnosis. It’s tricky to handle the CSS well given all the different configurations. If you have a specific suggestion we’ll try it out, otherwise it might be a while before we get to it.
Thanks for your response Bhante ![]()
I’m a recent volunteer contributor (Sr Staff SWE by profession, long-time volunteer FOSS maintainer and contributor in various ecosystems - see the links in my profile if curious), so the diagnosis is as much for me to look at later as for any other volunteer or staff/HongDa ![]()
And yes I’ve seen all the variations of how Bilara pages render in the code, I just mentioned all the complexities to a friend earlier today too ![]()
Conditionally (not) rendering the CSS is one option, but it’s often less complicated to just not render the HTML at all if it will be empty/invisible anyway. But I’d have to look closely at the component tree to see what’s best; at that point I might make a PR if I figure it out.
I’m working on a few other things in the codebase (mainly properly configuring and automating linters to catch bugs and format style automatically), so leaving on the TODO list for now.
And as Ven. Snowbird mentioned, this might be a past bug too, so would want to check some history and/or write a regression test for this case specifically too
I can’t recall this one. It looks like Anton is onto it. Lmk if y’all need any help.
Revisiting this now that I have substantially more experience with the codebases. This is indeed a confusing one, since the empty lines and HTML, including the CSS classes, are sourced from bilara-data.
In particular, the HTML is sourced from the root Pali and there currently isn’t a standardized way to overwrite that in a specific translation (for cases like this). I feel like that would be the proper way of fixing this – translation-specific HTML overrides.
But since that would be a pretty complex feature, I tried to workaround this. This is also a pretty rare case afaict – I believe the only time there is a margin that could cause this is in verse. So this would only happen when verse is abbreviated/omitted due to repetition in a translation. As such, I think a one-line workaround is justified at the moment.
It’s a fairly complicated bit of CSS, but is a one-liner(ish). I had to detect empty content using the :empty pseudo-class, but the margin is actually in a parent element, so then had to combine that with the :has pseudo-class. Pseudo-classes allow for some pretty nuanced detection these days; that would have to be done in JS in the past, which would be much more hacky, especially in this case where the HTML is statically pre-generated.
So I hadn’t tested different note views as I didn’t think that was relevant for this, but apparently this is still broken for sidenotes. For no notes and asterisk tooltip notes, it’s now fixed, but sidenotes use a different stylesheet. Notably, that one doesn’t have this margin at all, so the workaround has to be different.
The sidenotes stylesheet also uses display: grid (vs display: block), so operates a bit differently.
Fixed the sidenotes in a follow-up PR: fix(styles): don't show empty translations when side notes enabled by agilgur5 · Pull Request #3742 · suttacentral/suttacentral · GitHub



