| Name | Modified | Size | Downloads / 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 insplitSoftWrappedInlineBackground: - 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>withwhite-space: break-spacesorwhite-space: pre-wrapand literal\n\nnewline characters ("Sa714ed\n\nHope you're both ok xx"). - In
splitSoftWrappedInlineBackground, the character-by-characterRange.getClientRects()scanner skipped\ncharacters that had0x0dimensions. When the scanner reached the first character of the line after the blank gap ('H'of"Hope"), it detected a verticaltopjump (2 * lineStride), recorded only a single breakpoint, ranbp.node.nodeValue.replace(/[ \t\r\n]+$/, '')(which stripped both preceding\n\nnewline 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>. WhensplitInlineBackgroundAtBrextracted content up to that<br>and removed the<br>, the empty<div></div>collapsed to0pxheight and the second line break was lost. - Zero-Width / Non-Breaking Space Detection & Post-Split Step Verification:
hasContentonly 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
- Explicit Newline Normalization (
convertPreservedNewlinesToBr): - Before scanning for soft wraps,
convertPreservedNewlinesToBrwalks all text nodes whose computedwhite-spacepreserves newlines (pre,pre-wrap,pre-line,break-spaces) and converts every\r\nor\ninto an explicit<br>element (\n\nbecomes<br><br>). - Nested Block Boundary Unwrapping (
unwrapNestedBlocksToBr): - 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>) sosplitInlineBackgroundAtBrprocesses every line break uniformly. - Multi-Line Step Scaling in
splitSoftWrappedInlineBackground: splitSoftWrappedInlineBackgroundresetscurrentLineTopwhenever it crosses an explicit<br>element, only trims horizontal trailing spaces/tabs (/[ \t]+$/, never stripping\ror\n), and calculatesbrCount = Math.max(1, Math.round(stepPx / lineStride))so any multi-line vertical jump inserts the exact number of<br>tags matching the vertical gap.- Non-Collapsible Transparent Spacer Blocks & Pre-Split
lineGroupsStep Verification: - Empty lines between
<br>tags are emitted as explicit block-level transparent spacers (data-op-line-spacer="true") withheight: lineStrideandmin-height: lineStride. measureInlineBgMetricsrecords the exact pre-splitlineGroups({ top, height }) of every visible text line before DOM mutation. After splitting, bothsplitInlineBackgroundAtBr(per background element) andnormalizeTextBackgroundsForPrintPass 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 toprevLine.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\nBlank Lines: Verified that literal\n\nnewlines insidewhite-space: pre-wrap/break-spacesspans are converted to<br><br>and never stripped bysplitSoftWrappedInlineBackground. - [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
0pxcorners,white-space: nowrap/pre, andMath.ceilwidth locking remain intact. - [x] Service Worker & Cachebuster Sync: Verified
sw.jscache name isopen-publisher-v5-9-5and asset queries acrossindex.htmlreference?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