Skip to content

Fix italics leak with per-fragment div-balancing - #1388

Closed
LAfricain wants to merge 1 commit into
crosswire:masterfrom
LAfricain:IntroMaterialFragmentFix
Closed

LAfricain wants to merge 1 commit into
crosswire:masterfrom
LAfricain:IntroMaterialFragmentFix

Conversation

@LAfricain

Copy link
Copy Markdown
Contributor

Third attempt at the introMaterial() italics leak (#921 follow-up).

Previous attempts each fixed the leak but caused a new regression:

This attempt balances each fetched OSIS fragment (chapter 0 and/or thisChapter "verse 0" text) individually, right where it is fetched, instead of accumulating corrections at the end of the whole intro block. The missing closing tags land immediately next to their own content rather than stacked far from their opening, which should be far less disruptive to surrounding block structure. The verse-text wrapping span is removed entirely -- no longer needed, and no new element is introduced around verse text at all.

Local testing: italics stay confined to the chapter intro on modules with rich introductions (e.g. FreCrampon), and Karl's column/anchor scenario (4 columns, whole-book rendering, Deu 24:17) checks out. Could not reproduce the justification issue locally to verify the fix for it; requesting Karl test this branch before merge.

… span

Third attempt at the introMaterial() italics leak (crosswire#921 follow-up).

Previous attempts each fixed the leak but caused a new regression:
- Balancing the whole accumulated intro string and stacking missing
  </div> closes at the very end (original crosswire#1385) shifted block-level
  boundaries enough to break WebKit's column-break and anchor-scroll
  positioning in multi-column, whole-book rendering (Karl, crosswire#1385
  comments).
- Wrapping every verse's text in a defensive <span style="font-style:
  normal;"> (the fix for that regression, crosswire#1387) stopped italics
  bleeding onto verse text, but is suspected of interfering with
  WebKit's last-line detection for text-align: justify, producing
  over-justified lines (Karl, crosswire#1385 comments, reproducible with
  Justify margins + 4 columns + whole-book rendering; not yet
  reproduced locally on this end).

This attempt balances each fetched OSIS fragment (chapter 0 and/or
thisChapter "verse 0" text) individually, right where it is fetched,
instead of accumulating corrections at the end of the whole intro
block. The missing closing tags land immediately next to their own
content rather than stacked far from their opening, which should be
far less disruptive to surrounding block structure. The verse-text
wrapping span is removed entirely -- no longer needed, and no new
element is introduced around verse text at all.

Local testing: italics stay confined to the chapter intro on modules
with rich introductions (e.g. FreCrampon), and Karl's column/anchor
scenario (4 columns, whole-book rendering, Deu 24:17) checks out.
Could not reproduce the justification issue locally to verify the
fix for it; requesting Karl test this branch before merge.
@LAfricain LAfricain closed this Aug 23, 2026
@LAfricain

Copy link
Copy Markdown
Contributor Author

Well, I just realized that the current version of Frecrampon has a really big problem—I don't understand how I missed it—so you can't use it as an example. I had an old version on my computer. I need to update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant