Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.8.7
Name Modified Size InfoDownloads / Week
Parent folder
OpenPublisher5-i386-windowsXP.exe 2026-10-16 56.5 MB
openpublisher5_amd64-windows-portable.exe 2026-10-16 183.2 MB
openpublisher5_amd64-windows.exe 2026-10-16 165.2 MB
openpublisher5_amd64-macos.dmg 2026-10-16 233.1 MB
openpublisher5_amd64-linux.run 2026-10-16 193.4 MB
openpublisher5_amd64-linux.rpm 2026-10-16 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-10-16 153.6 MB
5.8.7_ Grammar Underline Bleed _ Context Menu Proofing Resolution source code.tar.gz 2026-10-16 23.3 MB
5.8.7_ Grammar Underline Bleed _ Context Menu Proofing Resolution source code.zip 2026-10-16 23.6 MB
README.md 2026-10-16 9.4 kB
openpublisher5_amd64-linux.deb 2026-10-16 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-10-16 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-10-16 185.5 MB
Totals: 13 Items   1.8 GB 0

πŸš€ Summary

Version 5.8.7 resolves two critical text proofing and contextual menu interactions in OpenPublisher: green squiggly grammar lines stretching or bleeding into neighboring words and whitespace, and grammar check suggestions failing to display in the right-click context menu when misspelled words are present or when right-clicking text boxes.

This release delivers comprehensive accuracy improvements to the CSS Custom Highlight proofing system and context menu dispatching pipeline:

  1. Grammar Underline Accuracy (No More Bleed or Truncation): LanguageTool tokenizes contractions like it's into separate tokens (it and 's). For sentence start capitalization, LanguageTool previously flagged only it, leaving the squiggly underline truncated to it while clipping or bleeding into adjacent characters. In v5.8.7, sentence start and casing checks automatically expand contraction suffixes so the entire contraction (it's) is highlighted and replaced cleanly.
  2. Elimination of Whitespace Squiggles & Edge Bleed: Whitespace rules flagging double spaces are now skipped during visual highlight painting to eliminate floating detached squiggles. Additionally, createRangeForOffsets strictly trims leading and trailing whitespace characters, ensuring wavy underlines never bleed across blank spaces.
  3. Context Menu Editable Resolution (Text Box Context Menu Fix): Fixed a broken ternary evaluation in ui/menus.js where right-clicking an outer element wrapper failed to resolve the inner [contenteditable="true"] child element, leaving _currentSpellCheckEditable as null and suppressing all grammar suggestions. A dedicated context resolver now robustly identifies the active editable container across outer element wrappers, caret ranges, selections, and active state.
  4. W3C Range Boundary Overlap Correction: Corrected the boundary point comparisons in getIssueAt(). The previous logic incorrectly checked <= 0 and >= 0, requiring ranges to simultaneously precede and succeed each other. The updated logic accurately validates range intersection (END_TO_START > 0 and START_TO_END < 0), collapsed caret containment, and multi-word token overlap.
  5. Detached Range DOMException Prevention: When text in an editable container is modified, text nodes are recreated, causing cached DOM Range objects to disconnect. paintHighlights and getIssueAt now detect disconnected ranges (!range.startContainer.isConnected) and recreate them on the fly.
  6. Context Menu Proofing Replacement Preservation: Proofing ranges are now preserved while the context menu remains open and cleared only upon menu closure, allowing applyGrammar and applySpelling to apply replacements directly to the targeted text range.

πŸ” Architecture & Technical Implementation

1. Grammar Underline Bleed & Contraction Truncation Root Cause & Solution

  • The Issue: LanguageTool tokenizes contractions like it's as it and 's. For rules such as UPPERCASE_SENTENCE_START, it returned an offset covering only it. This caused only it to receive the green underline. Furthermore, speculative token snapping previously shifted offsets backward into preceding words, while whitespace rules (WHITESPACE_RULE) generated squiggly lines underneath whitespace.
  • The Solution in tools/proofing/spellcheck-engine.js:
  • In checkEditableWithLanguageTool:
    • Discard pure whitespace matches (matchedStr.trim().length === 0).
    • Inspect contraction suffixes following the match with /^(['’][A-Za-z]+)/. When a contraction suffix is detected for casing or sentence start rules, expand matchLength, matchedStr, and all replacement strings so the entire contraction is underlined and replaced.
  • In createRangeForOffsets:
    • Trim any leading or trailing whitespace bounds using index scanning before creating DOM Range endpoints.
    • Removed speculative token snapping that shifted ranges into neighboring words.
  • In paintHighlights:
    • Verify that cached grammar ranges are still attached to the DOM (range.startContainer.isConnected), recreating detached ranges automatically.

2. Context Menu Multi-Issue Suppression Root Cause & Solution

  • The Issue: Right-clicking a grammar error failed to show grammar suggestions whenever misspelled words existed or when right-clicking a text box. This was caused by three interacting bugs:
  • Broken Ternary in ui/menus.js: (e.target && e.target.closest) was always truthy. When right-clicking .pub-element, e.target.closest('[contenteditable="true"]') returned null because the editable is a child element, not an ancestor. The fallback el.querySelector('[contenteditable="true"]') was never reached, setting _currentSpellCheckEditable = null.
  • Inverted Range Overlap in getIssueAt: Comparing Range.END_TO_START <= 0 and Range.START_TO_END >= 0 required the test range to end before the issue starts AND start after the issue ends, which is mutually exclusive. Overlap checks always failed.
  • Premature Range Clearing: window._currentSpellCheckRange was cleared immediately after rendering the context menu HTML, so clicking a suggestion had no target range to replace.
  • The Solution in ui/menus.js & ui/ui.js:
  • Implemented getEditableFromContext(target, container) in ui/menus.js to inspect the target element, container element, caret position range, and active selection.
  • Preserved _currentSpellCheckRange while the context menu is open, moving cleanup to ContextMenuSystem.hide().
  • In ui/ui.js, added fallback range resolution to applySpelling and applyGrammar using window.getSelection().
  • In tools/proofing/spellcheck-engine.js, corrected range overlap comparisons to END_TO_START > 0 and START_TO_END < 0, and added multi-cache scanning across active editable containers.

πŸ“ Files Modified in 5.8.7

File Changes
tools/proofing/spellcheck-engine.js Trimmed whitespace and eliminated speculative token snapping in createRangeForOffsets. Verified range connection in paintHighlights. Handled contraction expansion and whitespace skipping in checkEditableWithLanguageTool. Fixed overlap boundary comparisons, root editable resolution, and detached range handling in getIssueAt. Header bumped to (v5.8.7).
ui/menus.js Added getEditableFromContext helper to reliably resolve contenteditable elements on text boxes and tables. Extended extractWordFromRange to drill down into text nodes when starting on element nodes. Preserved proofing range for context menu click actions and cleaned up in hide(). Header bumped to (v5.8.7).
ui/ui.js Added fallback range resolution to applySpelling and applyGrammar.
index.html Bumped all 85 script and style cachebusters to ?v=5.8.7.
sw.js Updated Service Worker cache namespace to open-publisher-v5-8-7 and header to (v5.8.7).
extensions/legacy-fixes.js Added header comment (v5.8.7).
extensions/print-engine.js Added header comment (v5.8.7).
extensions/pwa-install.js Bumped header comment to (v5.8.7).
extensions/ui-interactions.js Bumped header comment, console log, and About modal subtitle to v5.8.7.
ui/sidebar-context.js Bumped header comment to (v5.8.7).
ui/modals/card-sheet-modal.js Bumped header comment to (v5.8.7).
ui/modals/options-modal.js Bumped header comment to (v5.8.7).
core/core.js Bumped header comment to (v5.8.7).
core/boot.js Bumped header comment to (v5.8.7).

wrapper.html was not modified.


βœ… v5.8.7 Verification Checklist

  • [x] Grammar Underline Boundary Accuracy: Verified that green wavy highlights strictly match the intended grammar issue tokens without bleeding or shifting into adjacent words.
  • [x] Whitespace Trimming: Confirmed that createRangeForOffsets trims whitespace and never underlines whitespace or gaps.
  • [x] Contraction Expansion: Confirmed that contractions like it's are highlighted across the full word and replaced cleanly.
  • [x] Coexisting Spelling & Grammar Issues: Verified that right-clicking a grammar error displays grammar suggestions even when misspelled words exist in the same editable container.
  • [x] Point Range Context Menu Triggering: Confirmed that right-clicking whitespace, punctuation, or any token within a multi-word grammar error surfaces the suggestions menu.
  • [x] Root Editable Cache Retrieval: Verified that right-clicking inside nested <span>, <font>, or <div> tags resolves to the root editable for cache lookup.
  • [x] Suggestion Application: Verified that clicking a grammar or spelling suggestion in the context menu applies the replacement to the document and registers undo history.
  • [x] Service Worker & Cachebuster Sync: Verified sw.js cache name is open-publisher-v5-8-7 and all 85 asset query strings in index.html reference ?v=5.8.7.
  • [x] Subsystem Version Consistency: Confirmed all modified subsystems and modules reflect version 5.8.7.

image


πŸŽ‰ Version 5.8.7: Open Publisher

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