[xiphos-source] [crosswire/xiphos] a35891: Balance chapter HTML and fix intro-material italic...

LAfricain noreply at github.com
Fri Aug 21 07:28:46 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/crosswire/xiphos
  Commit: a3589177285025a68a5d491a47bf4baa02722b49
      https://github.com/crosswire/xiphos/commit/a3589177285025a68a5d491a47bf4baa02722b49
  Author: L'Africain <fr.cyrille at tiberiade.be>
  Date:   2026-08-21 (Fri, 21 Aug 2026)

  Changed paths:
    M src/main/display.cc
    M src/webkit/wk-html.c

  Log Message:
  -----------
  Balance chapter HTML and fix intro-material italics leaking into text (#1385)

Follow-up to #921: while chapter intro material (book/section
headings) is meant to render in italics via ".introMaterial { font-
style: italic; }", two related bugs let that styling — and malformed
markup in general — leak into the rest of the chapter on modules with
rich introductions (e.g. FreCrampon).

- GTKChapDisp::introMaterial() (src/main/display.cc): SWORD's OSIS
  filter can emit an opening <div type="subSection" ...> for a
  section heading with no matching closing </div> anywhere in the
  fetched text. Now counts <div>/</div> occurrences and appends any
  missing closing tags before closing our own wrapper, so the block
  is always self-balanced regardless of what the filter provides.

- wk_html_sanitize() (src/webkit/wk-html.c): parses the final
  assembled HTML with libxml2 (HTML_PARSE_RECOVER) and re-serializes
  it before handing it to WebKit, rather than letting WebKit's own
  parser silently repair mismatched tags unpredictably. General
  safety net for similar cases we may not have found yet.

- CSS: added ".introMaterial h2.chapterHeader { font-style: normal; }"
  so section/chapter titles stay upright — only the narrative intro
  text should be italic, not its headings.

Co-authored-by: lafricain79 <lafricain79 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/crosswire/xiphos/settings/notifications


More information about the xiphos-source mailing list