Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.9.5
Name Modified Size InfoDownloads / Week
Parent folder
OpenPublisher5-i386-windowsXP.exe 2026-10-17 56.5 MB
openpublisher5_amd64-windows-portable.exe 2026-10-17 183.2 MB
openpublisher5_amd64-windows.exe 2026-10-17 165.2 MB
openpublisher5_amd64-macos.dmg 2026-10-17 233.1 MB
openpublisher5_amd64-linux.run 2026-10-17 193.4 MB
openpublisher5_amd64-linux.rpm 2026-10-17 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-10-17 153.6 MB
openpublisher5_amd64-linux.deb 2026-10-17 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-10-17 166.4 MB
5.9.5_ Preserving Extra Blank Lines _ Vertical Line Gaps in Printed Text Backgrounds source code.tar.gz 2026-10-17 23.3 MB
5.9.5_ Preserving Extra Blank Lines _ Vertical Line Gaps in Printed Text Backgrounds source code.zip 2026-10-17 23.6 MB
README.md 2026-10-17 7.6 kB
openpublisher5_amd64-freebsd.pkg 2026-10-17 185.5 MB
Totals: 13 Items   1.8 GB 0

🚀 Summary

Version 5.9.5 fixes an issue where extra blank lines (<br><br>, preserved \n\n newline characters inside pre-wrap / break-spaces spans, or nested <div><br></div> block boundaries) inside highlighted text were skipped during print and PDF export, causing paragraphs separated by an empty line in the editor (such as the blank line between "Sa714ed" and "Hope you're both ok xx") to collapse directly against each other on print.

Open Publisher v5.9.5 converts preserved newline characters and nested block boundaries into explicit <br> breaks prior to soft-wrap analysis, preserves multi-line vertical jumps across soft-wrap breakpoints, renders dedicated non-collapsible transparent spacer blocks for empty lines, and verifies post-split vertical line steps against the live editor's pre-split getClientRects() line positions so that all blank line gaps are faithfully preserved on print.


🔍 Root Cause Analysis & Architecture Solution

1. Why Blank Lines Were Skipped on Print in v5.9.3 and v5.9.4

  • Preserved Newlines (\n\n) Stripped in splitSoftWrappedInlineBackground:
  • When multi-line messages containing blank lines are pasted from web applications (such as Discord, Messenger, or WhatsApp Web), the text is often stored inside an inline <span> with white-space: break-spaces or white-space: pre-wrap and literal \n\n newline characters ("Sa714ed\n\nHope you're both ok xx").
  • In splitSoftWrappedInlineBackground, the character-by-character Range.getClientRects() scanner skipped \n characters that had 0x0 dimensions. When the scanner reached the first character of the line after the blank gap ('H' of "Hope"), it detected a vertical top jump (2 * lineStride), recorded only a single breakpoint, ran bp.node.nodeValue.replace(/[ \t\r\n]+$/, '') (which stripped both preceding \n\n newline characters), and inserted only one <br>, completely erasing the blank line.
  • Nested Block Boundaries (<div><br></div>) Inside Inline Spans:
  • When a blank line inside an inline background span was represented as nested blocks (Sa714ed<div><br></div><div>Hope...</div>), there was only a single <br> tag inside the empty <div><br></div>. When splitInlineBackgroundAtBr extracted content up to that <br> and removed the <br>, the empty <div></div> collapsed to 0px height and the second line break was lost.
  • Zero-Width / Non-Breaking Space Detection & Post-Split Step Verification:
  • hasContent only checked .textContent.trim().length > 0, which could treat invisible zero-width characters (\u200b, \ufeff) on otherwise empty <br> lines as non-empty lines or fail to restore vertical spacing if a complex nested DOM structure absorbed a blank line gap.

2. Multi-Layer Blank Line Preservation Pipeline

  1. Explicit Newline Normalization (convertPreservedNewlinesToBr):
  2. Before scanning for soft wraps, convertPreservedNewlinesToBr walks all text nodes whose computed white-space preserves newlines (pre, pre-wrap, pre-line, break-spaces) and converts every \r\n or \n into an explicit <br> element (\n\n becomes <br><br>).
  3. Nested Block Boundary Unwrapping (unwrapNestedBlocksToBr):
  4. Any nested <div> or <p> elements inside an inline background element are unwrapped into explicit <br> boundaries before and after the block (converting placeholder <div><br></div> blocks into <br><br>) so splitInlineBackgroundAtBr processes every line break uniformly.
  5. Multi-Line Step Scaling in splitSoftWrappedInlineBackground:
  6. splitSoftWrappedInlineBackground resets currentLineTop whenever it crosses an explicit <br> element, only trims horizontal trailing spaces/tabs (/[ \t]+$/, never stripping \r or \n), and calculates brCount = Math.max(1, Math.round(stepPx / lineStride)) so any multi-line vertical jump inserts the exact number of <br> tags matching the vertical gap.
  7. Non-Collapsible Transparent Spacer Blocks & Pre-Split lineGroups Step Verification:
  8. Empty lines between <br> tags are emitted as explicit block-level transparent spacers (data-op-line-spacer="true") with height: lineStride and min-height: lineStride.
  9. measureInlineBgMetrics records the exact pre-split lineGroups ({ top, height }) of every visible text line before DOM mutation. After splitting, both splitInlineBackgroundAtBr (per background element) and normalizeTextBackgroundsForPrint Pass 3 (across all split lines in the text box) compare the post-split vertical step between consecutive non-empty lines against the pre-split editor step (editorStep - currentStep >= lineStride * 0.5) and add any missing vertical gap directly to prevLine.style.marginBottom.

📁 Files Modified in 5.9.5

File Changes
extensions/print-engine.js Added convertPreservedNewlinesToBr and unwrapNestedBlocksToBr; updated measureInlineBgMetrics, splitSoftWrappedInlineBackground, splitInlineBackgroundAtBr, and normalizeTextBackgroundsForPrint to preserve <br>, \n\n, and nested block blank lines with pre-split vertical step verification. Bumped header to (v5.9.5).
index.html Updated all script, stylesheet, and asset cachebuster queries in <head> and <body> from ?v=5.9.4 to ?v=5.9.5.
sw.js Updated Service Worker cache namespace to open-publisher-v5-9-5 and header to (v5.9.5).
elements/text/text.js Bumped header comment to (v5.9.5).
core/core.js Bumped header comment to (v5.9.5).
core/boot.js Bumped header comment to (v5.9.5).
extensions/legacy-fixes.js Bumped header comment to (v5.9.5).
extensions/ui-interactions.js Bumped header comment and initialization log to (v5.9.5).
extensions/pwa-install.js Bumped header comment to (v5.9.5).
ui/menus.js Bumped header comment to (v5.9.5).
ui/sidebar-context.js Bumped header comment to (v5.9.5).
ui/modals/card-sheet-modal.js Bumped header comment to (v5.9.5).
ui/modals/options-modal.js Bumped header comment to (v5.9.5).
tools/proofing/spellcheck-engine.js Bumped header comment to (v5.9.5).

wrapper.html was not modified.


✅ v5.9.5 Verification Checklist

  • [x] Preserved \n\n Blank Lines: Verified that literal \n\n newlines inside white-space: pre-wrap / break-spaces spans are converted to <br><br> and never stripped by splitSoftWrappedInlineBackground.
  • [x] Nested <div><br></div> Blank Lines: Verified that nested block elements inside inline background spans are unwrapped into explicit <br> boundaries so empty lines never collapse.
  • [x] Pre-Split Vertical Step Verification: Confirmed that post-split vertical steps between consecutive non-empty lines are verified against pre-split getClientRects() line positions both within each background span and across sibling spans in the text box.
  • [x] All v5.9.3 & v5.9.4 Fixes Preserved: Confirmed 1-2px inter-line gaps, sharp 0px corners, white-space: nowrap / pre, and Math.ceil width locking remain intact.
  • [x] Service Worker & Cachebuster Sync: Verified sw.js cache name is open-publisher-v5-9-5 and asset queries across index.html reference ?v=5.9.5.
  • [x] Subsystem Version Consistency: Confirmed all modified subsystems and modules reflect version 5.9.5.

🎉 Version 5.9.5: Open Publisher

Source: README.md, updated 2026-10-17