UPG100 poster header: scripture references stay whole; the classic header drops bold markers

- A scripture reference never breaks between its book and its
  chapter:verse in the header's text columns ("Mark 6:40"); before, two
  zones printed "(Mark" at a line's end and "6:40)." on the next.
- (With the parent commit: the three header columns end at about the same
  height. The facts column widens when it runs long, the side columns stay
  equal and mirrored; across the 28 zones the height spread drops from
  99 to 72 px, mean 54 to 34.)
This commit is contained in:
Doxa Maps 2026-10-03 08:59:50 +00:00
parent 4ec5905492
commit 4c3a118d2e

View file

@ -860,6 +860,9 @@ function boldLines(text, width) {
for (let i = 0; i < part.length; i++) { plain += part[i]; bold.push(on); } // per UTF-16 unit, as plain[p] reads
on = !on;
}
// A scripture reference never breaks between its book and its chapter:verse ("Mark 6:40"): that space becomes a
// placeholder for the wrap and prints as a space again. One character for one, so the bold flags stay aligned.
plain = plain.replace(/([A-Za-z]+) (\d+:\d+)/g, '$1\u0001$2');
let p = 0;
return wrapPx(plain, HC.fs, width).map((ln) => {
while (plain[p] === ' ') p++;
@ -867,7 +870,7 @@ function boldLines(text, width) {
const flush = () => { if (run) out += runBold ? `<tspan class="hcolb">${esc(run)}</tspan>` : esc(run); run = ''; };
for (let k = 0; k < ln.length; k++, p++) {
if (bold[p] !== runBold) { flush(); runBold = bold[p]; }
run += plain[p];
run += plain[p] === '\u0001' ? ' ' : plain[p];
}
flush();
return out;