| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| 5.4.7_ Visual Grammar Engine _ Contextual Proofing Underlines source code.tar.gz | 2026-10-07 | 22.5 MB | |
| 5.4.7_ Visual Grammar Engine _ Contextual Proofing Underlines source code.zip | 2026-10-07 | 22.7 MB | |
| README.md | 2026-10-07 | 22.9 kB | |
| OpenPublisher-5-x86_64.AppImage | 2026-10-07 | 166.4 MB | |
| openpublisher5_amd64-windows-portable.exe | 2026-10-07 | 183.2 MB | |
| openpublisher5_amd64-windows.exe | 2026-10-07 | 165.2 MB | |
| openpublisher5_amd64-macos.dmg | 2026-10-07 | 233.1 MB | |
| openpublisher5_amd64-linux.run | 2026-10-07 | 193.4 MB | |
| openpublisher5_amd64-linux.rpm | 2026-10-07 | 215.4 MB | |
| openpublisher5_amd64-linux.flatpak | 2026-10-07 | 153.6 MB | |
| openpublisher5_amd64-linux.deb | 2026-10-07 | 156.2 MB | |
| openpublisher5_amd64-freebsd.pkg | 2026-10-07 | 185.5 MB | |
| Totals: 12 Items | 1.7 GB | 0 | |
🚀 Summary
Version 5.4.7 of Open Publisher introduces a dedicated Visual Grammar & Contextual Proofing Engine powered by the W3C CSS Custom Highlight API (::highlight(grammar-error)), working harmoniously alongside the visual spell check engine. This feature provides crisp, high-visibility green wavy squiggly underlines (#27ae60) for grammar issues, contextual spelling mistakes (such as there vs. their or its vs. it's), repeated words (the the), incorrect indefinite articles (a vs. an), capitalization mistakes, and typography formatting errors across all zoom scales (including default 60% view). By extending Open Publisher's existing online proofing pipeline (LanguageTool) with client-side classification and DOM Range mapping, the system operates with zero bundled dictionaries or grammar databases, keeping the application ultralight, fast, and responsive.
In addition, this release ensures that green grammar underlines and red spelling underlines remain completely solid and continuous under words and phrases by disabling ink skipping (text-decoration-skip-ink: none !important;). The right-click context menu now intelligently inspects the clicked text range: when right-clicking a green squiggly line, a green grammar explanation card appears with human-readable guidance, one-click replacement suggestions, and an "Ignore Rule" option that persists across sessions. Applying suggestions cleanly swaps out the erroneous phrase across text nodes without corrupting DOM formatting or caret focus.
Prior to this release, Open Publisher only presented red squiggly underlines for misspellings. Contextual spelling blunders ("We went to there house"), subject-verb disagreements ("She go to school"), duplicate words ("in the the car"), or article errors ("an book") went unnoticed by the visual renderer because LanguageTool's rich grammar rule matches were discarded or conflated with spell check. Furthermore, users had no way to inspect grammar guidance or replace multi-word grammatical constructs directly from the right-click menu.
In v5.4.7, visual proofing is elevated to a comprehensive desktop-publishing standard:
- Dual Visual Proofing Engine: Simultaneously renders red wavy underlines (
#e74c3c) for misspelled words and green wavy underlines (#27ae60) for grammar, contextual spelling, repeated words, and formatting blunders. - W3C CSS Custom Highlight Integration: GPU-accelerated rendering via
::highlight(grammar-error)and::highlight(spelling-error)that remains crisp, solid, and aligned across all zoom levels (60%, 75%, 100%, 150%, 200%). - Unbroken Continuous Underlines (
text-decoration-skip-ink: none): Prevents characters with descenders (g, y, p, q, j) from punching gaps in the wavy lines, delivering continuous squiggly underlines. - Accurate Error Classification (
classifyMatch): Separates raw dictionary typos (TYPOS) from grammatical rules (GRAMMAR,CONFUSED_WORDS,CASING,TYPOGRAPHY,PUNCTUATION,MISC,STYLE,REDUNDANCY). - Contextual Spelling Detection: Detects valid English words used in invalid contexts (there/their/they're, your/you're, affect/effect, its/it's) and flags them with green squigglies.
- Repeated Word & Article Detection: Flags duplicate words (the the) and mismatched indefinite articles (an book, a apple) with green underlines.
- Multi-Node DOM Range Mapping (
createRangeForOffsets): Maps LanguageTool string character offsets directly across arbitrary text nodes, child spans, and line breaks without altering document HTML. - Interactive Grammar Context Menu: Right-clicking an active grammar issue reveals a green explanation banner (
<i class="fas fa-check-circle"></i>), 1-click replacement buttons, and an "Ignore Rule" action. - Persistent Rule Ignoring: Ignoring a grammar rule persists its identifier in
localStorage(opub_ignored_grammar_rules) to prevent repeated prompts on recurring stylistic choices. - Clean Range Replacement (
applyGrammar): Applies grammar suggestions viarange.deleteContents()andrange.insertNode(), seamlessly preserving surrounding elements and updating undo/redo history. - Zero Bundled Dictionaries or Rule Files: Connects directly to Open Publisher's existing online proofing service with in-memory caching (
_editableCache), avoiding static payload bloat. - Print and PDF Export Concealment: Dedicated
@media printrules ensure green and red squigglies never appear on printed output or exported PDF files. - Global Synchronization: Toggling spellcheck or updating text boxes re-scans proofing ranges in real time without lag.
All cachebusters across index.html, the Service Worker cache (open-publisher-v5-4-7), and subsystem headers have been synchronized to v5.4.7.
🔍 Problems Solved & Key Enhancements
- Absence of Visual Grammar & Contextual Feedback:
- Problem: Previous versions only displayed red underlines for misspelled words. Words that were spelled correctly in isolation but grammatically invalid in context (such as "there house", "she go", "an book", or "the the") had no visual indicator on the canvas.
-
Solution in v5.4.7: Extended the proofing engine in
tools/proofing/spellcheck-engine.jsto manage dual CSS highlight collections:spelling-error(red) andgrammar-error(green). LanguageTool API matches are classified using rule categories and issue types so each problem receives its dedicated styling. -
Accurate Classification of Contextual Spelling vs. Typos:
- Problem: LanguageTool frequently labels confused words (like there vs. their) with
issueType: "misspelling", which previously routed them to red spellcheck. Users expect confused words and grammar mistakes to display green squigglies, reserving red exclusively for non-words. -
Solution in v5.4.7: Implemented
classifyMatch(m)which checksm.rule.category.id. Matches fromCONFUSED_WORDS,MISC(e.g.,EN_A_VS_AN,ENGLISH_WORD_REPEAT_RULE),CASING,TYPOGRAPHY, andGRAMMARare routed togrammar-error, whileTYPOSis routed tospelling-error. -
Multi-Node DOM Range Reconstruction:
- Problem: Grammar issues often span multiple words or cross text nodes separated by inline styles (such as bold or italic spans). Simple string searches or single-node offset tracking failed when an error crossed node boundaries.
-
Solution in v5.4.7: Implemented
createRangeForOffsets(root, startOffset, length)using aTreeWalkerto traverse text nodes cumulatively. This constructs exactRangeinstances spanning across text node boundaries without modifyinginnerHTML. -
Right-Click Context Menu Grammar Card:
- Problem: Right-clicking an erroneous word only displayed spellcheck replacements. Grammar issues have contextual explanations (e.g. "Did you mean 'their'?" or "The pronoun 'She' is usually used with a third-person verb") that require readable guidance.
-
Solution in v5.4.7: Added
SpellCheckEngine.getIssueAt(editable, word, range)to test bounding intersection with active grammar issues. Inui/menus.js, detecting a grammar issue injects a green explanation banner, magic wand replacement buttons, and an "Ignore Rule" action. -
Multi-Word & Cross-Node Suggestion Replacement:
- Problem: Previous suggestion replacement assumed single-node text splicing. Replacing multi-word grammar mistakes (like replacing "a apple" with "an apple") caused text truncation or index corruption.
-
Solution in v5.4.7: Upgraded replacement logic in
ui/ui.js(ContextMenuActions.applyGrammarandapplySpelling). When replacing text across a range, it checks ifstartContainer === endContainer; if so, it updatestextContent, and if crossing nodes, it cleanly executesrange.deleteContents()andrange.insertNode(), followed by history committing and proofing refresh. -
Persistent Rule Ignoring:
- Problem: Users writing specialized publications or stylistic prose frequently encounter false positive grammar warnings (e.g. sentence fragments in headlines).
-
Solution in v5.4.7: Added
ignoreGrammarRule(ruleId), persisting ignored rule IDs intolocalStorage.getItem('opub_ignored_grammar_rules'). Ignored rules are immediately bypassed on subsequent proofing passes. -
Zero Bloat Guarantee:
- Problem: Adding offline grammar engines or neural grammar bundles would add tens of megabytes to the application footprint.
- Solution in v5.4.7: Zero bundled grammar databases or dictionaries. Proofing relies entirely on Open Publisher's existing LanguageTool API combined with client-side caching (
_editableCache).
🛠️ Complete Architectural Breakdown
1. Dual Highlight Proofing Engine (tools/proofing/spellcheck-engine.js)
- Dual Highlight Registration:
CSS.highlights.set('spelling-error', new Highlight(...spellingRanges))CSS.highlights.set('grammar-error', new Highlight(...grammarRanges))-
Intelligent Classification Pipeline (
classifyMatch): ```javascript function classifyMatch(m) { const catId = m.rule && m.rule.category ? m.rule.category.id : ''; const ruleId = m.rule ? m.rule.id : ''; const issueType = (m.rule && m.rule.issueType) || ''; const shortMsg = m.shortMessage || '';if (catId === 'TYPOS' || shortMsg === 'Spelling mistake') { return 'spelling'; } if (['GRAMMAR', 'CONFUSED_WORDS', 'CASING', 'TYPOGRAPHY', 'PUNCTUATION', 'MISC', 'STYLE', 'REDUNDANCY'].includes(catId)) { return 'grammar'; } if (ruleId.includes('A_VS_AN') || ruleId.includes('REPEAT') || ruleId.includes('THERE_THEIR') || ruleId.includes('ITS_ITS')) { return 'grammar'; } return issueType === 'misspelling' ? 'spelling' : 'grammar'; } ```
-
Text Node Offset Mapping (
createRangeForOffsets): - Traverses
NodeFilter.SHOW_TEXTnodes in sequence. - Accumulates character length to locate exact
startContainer/startOffsetandendContainer/endOffset. - Creates and validates the DOM
Rangeobject. - Issue Intersection Finder (
getIssueAt): - Compares the clicked caret Range with active recorded issues using
range.compareBoundaryPoints. - Accurately locates whether the right-clicked token corresponds to a grammar issue or a spelling typo.
- Ignored Grammar Rules:
- Maintained in
_ignoredRulesSetand synced tolocalStorage. - Matches with matching rule IDs are discarded before ranges are built.
2. High-Visibility Continuous Styling & Print Concealment (style.css)
:::css
/* Modern Chromium / Edge Spellcheck & Grammar Proofing under Canvas Transform (v5.4.7) */
::highlight(spelling-error) {
text-decoration: underline wavy #e74c3c !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
::highlight(grammar-error) {
text-decoration: underline wavy #27ae60 !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
@media print {
::highlight(spelling-error),
::highlight(grammar-error) {
text-decoration: none !important;
}
}
[contenteditable="true"],
.element-content,
.element-content [contenteditable="true"] {
text-decoration-skip-ink: none !important;
}
::spelling-error {
text-decoration: underline wavy #e74c3c !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
::grammar-error {
text-decoration: underline wavy #27ae60 !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
[contenteditable="true"]::spelling-error,
.element-content [contenteditable="true"]::spelling-error {
text-decoration: underline wavy #e74c3c !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
[contenteditable="true"]::grammar-error,
.element-content [contenteditable="true"]::grammar-error {
text-decoration: underline wavy #27ae60 !important;
text-decoration-skip-ink: none !important;
text-decoration-thickness: 2px !important;
text-underline-offset: 3px !important;
}
[spellcheck="false"]::spelling-error,
[contenteditable="true"][spellcheck="false"]::spelling-error,
[spellcheck="false"]::grammar-error,
[contenteditable="true"][spellcheck="false"]::grammar-error {
text-decoration: none !important;
}
3. Context Menu Proofing Suite (ui/menus.js & ui/ui.js)
- Inspection & Header Construction:
- Intercepts right clicks on text boxes and evaluates
ProofingEngine.getIssueAt. - If a grammar issue is detected, renders a green explanation card:
<div class="pub-context-item" style="color:#27ae60; ..."><i class="fas fa-check-circle"></i> ${ruleMsg}</div> - Lists top suggestions styled with magic wand icons:
<b>${suggestion}</b>. - Appends an "Ignore Rule" action button.
- Suggestion Application (
ContextMenuActions.applyGrammar): - Locks active range to
activeIssue.range. - Removes erroneous nodes and inserts corrected text node.
- Pushes an immediate history snapshot (
pushHistory). - Immediately re-runs
ProofingEngine.run()to clear squiggly lines.
🛠️ Files Modified & Added
- tools/proofing/spellcheck-engine.js: Extended proofing engine into a dual-collection system managing both
spelling-error(red) andgrammar-error(green), adding match classification, multi-node range mapping, issue intersection detection, and persistent ignored rules. - style.css: Added green wavy underline rules for
::highlight(grammar-error)and::grammar-error(#27ae60), unbroken descender styling (text-decoration-skip-ink: none), and print concealment under@media print. - ui/menus.js: Added grammar issue detection in context menu, displaying green guidance card, magic wand quick suggestions, and "Ignore Rule" action.
- ui/ui.js: Added
ContextMenuActions.applyGrammarand upgraded range replacement to support multi-node DOM structures cleanly. - index.html: Bumped all script, stylesheet, and asset cachebuster queries to
?v=5.4.7. - sw.js: Bumped Service Worker cache name to
open-publisher-v5-4-7and updated header tov5.4.7. - core/boot.js: Bumped bootstrapper header to
v5.4.7. - core/pages.js: Bumped serializer header to
v5.4.7. - elements/text/text.js: Bumped text engine header to
v5.4.7. - canvas/canvas.js: Bumped canvas ruler engine header to
v5.4.7. - canvas/interaction.js: Bumped interaction header to
v5.4.7. - canvas/interaction-mouse.js: Bumped interaction mouse header to
v5.4.7. - canvas/text-drag.js: Bumped text drag header to
v5.4.7. - elements/arrow/arrow.js: Bumped smart arrow engine header and initialization log to
v5.4.7. - elements/templates/templates.js: Bumped template fetch queries to
?v=5.4.7. - ui/dashboard.js: Bumped template index and opub fetch queries to
?v=5.4.7. - ui/modals/options-modal.js: Bumped options modal header to
v5.4.7. - ui/sidebar-context.js: Bumped sidebar context header to
v5.4.7. - extensions/theme-studio.js: Bumped Theme Studio header and initialization log to
v5.4.7. - extensions/system-patches.js: Bumped system patches comments to
v5.4.7. - extensions/ui-interactions.js: Bumped UI interactions header to
v5.4.7. - extensions/legacy-fixes.js: Bumped Theme Studio reference comment to
v5.4.7. - extensions/pwa-install.js: Bumped PWA install header and service worker registration query to
sw.js?v=5.4.7. - extensions/geo-defense.js: Bumped geo defense header to
v5.4.7.
🧪 Verification & Automated Testing
Validated through automated Playwright end-to-end test suites (test_v5_4_7_proofing.py, test_additional_grammar_rules.py):
| Test Scenario | Verification Metric | Result | Output Details |
|---|---|---|---|
| Dual Engine Availability | Check window.ProofingEngine & window.SpellCheckEngine |
Passed | Both engines initialized with full public API |
| CSS Highlight API Support | Check CSS.highlights availability |
Passed | Custom Highlight API active and operational |
| Compound Sentence Check | Sentence: "She go to school and mistdake happend." | Passed | 1 green grammar highlight ('go') and 2 red spelling highlights ('mistdake', 'happend') |
| Error Classification | Verify 'mistdake' vs. 'go' |
Passed | 'mistdake' is marked as misspelling; 'go' is marked as grammar issue |
| Contextual Spelling (their/there) | Sentence: "We went to there house." | Passed | Rule THERE_THEIR triggered with suggestion 'their'; highlighted green |
| Word Repetition (the the) | Sentence: "She is in the the car." | Passed | Rule ENGLISH_WORD_REPEAT_RULE triggered with suggestion 'the'; highlighted green |
| Indefinite Article (a/an) | Sentence: "I read an book yesterday." | Passed | Rule EN_A_VS_AN triggered with suggestion 'a'; highlighted green |
| Grammar Context Menu | Right-click directly over 'go' |
Passed | Context menu displays green header, 'goes' suggestion, and 'Ignore Rule' |
| Suggestion Application | Click 'goes' suggestion via applyGrammar |
Passed | Text updated to "She goes to school and mistdake happend."; squiggly removed |
| Unbroken Descender Styling | Underline continuous under letters with descenders | Passed | text-decoration-skip-ink: none prevents line breaks across y, g, p, q, j |
| Print Concealment | Verify @media print rules |
Passed | ::highlight(grammar-error) and ::highlight(spelling-error) hidden on print |
| Zero Bundled Dictionaries | Verify no dictionary or rule files loaded | Passed | Pure online checking with LanguageTool API + client caching |
| Cachebuster Synchronization | Grep 5.4.6 across entire repository |
Passed | Zero occurrences remaining; 100% updated to v5.4.7 |
✅ Complete v5.4.7 Feature & Verification Checklist
- [x] Green Squiggly Underlines: Implemented
::highlight(grammar-error)rendering crisp green wavy underlines (#27ae60) for grammar and contextual blunders. - [x] Simultaneous Dual Proofing: Red wavy lines for misspellings and green wavy lines for grammar render concurrently without collisions.
- [x] Contextual Spelling Checks: Correctly flags confused homophones (there/their, your/you're, its/it's) with green squigglies.
- [x] Word Repetition & Article Checks: Accurately flags duplicate words (the the) and mismatched articles (an book) with green squigglies.
- [x] Unbroken Continuous Underlines: Applied
text-decoration-skip-ink: none !important;so descenders (y, g, p, q, j) do not segment the squiggly lines. - [x] Scale-Invariant Highlighting: Tested across 60%, 100%, and 150% zoom levels; lines remain sharp and correctly offset from the text baseline.
- [x] Interactive Context Menu: Displays green explanation card, magic wand replacement buttons, and an "Ignore Rule" action on right click.
- [x] Clean DOM Replacement: Replaces multi-node and single-node phrases without corrupting document structure or cursor positioning.
- [x] Persistent Ignored Rules: Stores ignored grammar rule IDs in
localStorageto respect author styling choices across sessions. - [x] Zero Bundled Bloat: Zero offline dictionary or grammar files bundled; uses existing online LanguageTool service with intelligent client caching.
- [x] Print Concealment: Hidden during physical printing and PDF export via
@media print. - [x] Repository Synchronization: Updated all 24 subsystems, script tags, stylesheets, and Service Worker cache to
v5.4.7. - [x] Automated Testing: 100% test pass rate across end-to-end Playwright test suites.
🎉 Version 5.4.7 - Open Publisher