feat(source): add theme-aware Markdown syntax highlighting #16

Open
opened 2026-10-11 12:31:39 +00:00 by KofTwentyTwo · 2 comments
KofTwentyTwo commented 2026-10-11 12:31:39 +00:00 (Migrated from github.com)

When Markdown source is shown, it is currently a read-only plain-text TextBox. Add Markdown syntax highlighting that follows the selected document theme and Windows light/dark mode.

Acceptance:

  • Distinguish headings, emphasis/strikethrough, code spans/fences, links/images, lists/tasks, blockquotes and YAML frontmatter with readable token colors.
  • Update highlighting when the document palette or shell light/dark mode changes, including System mode; preserve contrast for ordinary text, selection and paired-find matches.
  • Keep the exact original Markdown available for selection/copy, including whitespace, CRLF and Unicode. Highlighting must not modify the file or execute authored HTML, CSS, scripts or links.
  • Preserve existing source/reader scroll and heading synchronization, source folding, paired find, zoom/focus behavior and per-window independence through reload and theme changes.
  • Bound parsing/update work for large supported documents and discard stale/closed-window updates. Prefer the existing parser/native controls; justify any new dependency.
  • Verify representative real token colors in light/dark/document themes, exact copied source and live-save updates in native/published and both installed channels. Maintain 100% measured core coverage and zero-warning build/format gates.

Requested by the owner for this Windows version. Related: #10 (source synchronization), #7 (themes), #1 (full application). Implementation and acceptance are pending.

Substantial AI assistance: Codex (GPT-6).

When Markdown source is shown, it is currently a read-only plain-text TextBox. Add Markdown syntax highlighting that follows the selected document theme and Windows light/dark mode. Acceptance: - Distinguish headings, emphasis/strikethrough, code spans/fences, links/images, lists/tasks, blockquotes and YAML frontmatter with readable token colors. - Update highlighting when the document palette or shell light/dark mode changes, including System mode; preserve contrast for ordinary text, selection and paired-find matches. - Keep the exact original Markdown available for selection/copy, including whitespace, CRLF and Unicode. Highlighting must not modify the file or execute authored HTML, CSS, scripts or links. - Preserve existing source/reader scroll and heading synchronization, source folding, paired find, zoom/focus behavior and per-window independence through reload and theme changes. - Bound parsing/update work for large supported documents and discard stale/closed-window updates. Prefer the existing parser/native controls; justify any new dependency. - Verify representative real token colors in light/dark/document themes, exact copied source and live-save updates in native/published and both installed channels. Maintain 100% measured core coverage and zero-warning build/format gates. Requested by the owner for this Windows version. Related: #10 (source synchronization), #7 (themes), #1 (full application). Implementation and acceptance are pending. Substantial AI assistance: Codex (GPT-6).
KofTwentyTwo commented 2026-10-11 14:40:18 +00:00 (Migrated from github.com)

Implemented native source highlighting locally using the existing Markdig parser and read-only RichEditBox character formats, with no HTML/RTF or authored URL capability. Document accents remain readable in Windows light/dark; high contrast uses system colors. Snapshot/cancellation and paint-generation guards protect reloads/palette changes. Plain copying maps visible native selections back to original Unicode/newline spelling and excludes rich formats; folded bodies stay omitted. Full core suite570/100% measured lines and zero-warning Release build pass. Two new actual native color/selection/palette/reload and real Unicode clipboard cases compile/discover only; existing find/fold/scroll/native accessibility acceptance remains required. Review-latest.md is open for manual feedback.

Implemented native source highlighting locally using the existing Markdig parser and read-only RichEditBox character formats, with no HTML/RTF or authored URL capability. Document accents remain readable in Windows light/dark; high contrast uses system colors. Snapshot/cancellation and paint-generation guards protect reloads/palette changes. Plain copying maps visible native selections back to original Unicode/newline spelling and excludes rich formats; folded bodies stay omitted. Full core suite570/100% measured lines and zero-warning Release build pass. Two new actual native color/selection/palette/reload and real Unicode clipboard cases compile/discover only; existing find/fold/scroll/native accessibility acceptance remains required. Review-latest.md is open for manual feedback.
KofTwentyTwo commented 2026-10-11 15:05:38 +00:00 (Migrated from github.com)

Correction to the earlier preview handoff: native startup first failed on unsupported HighContrastChanged event registration, then native formatting failed on the read-only RichEdit document. Replaced registration with marshalled UISettings color changes and wrapped native writes/character formatting in a synchronous guard restoring read-only state before return/yield. Both corrected Review-updated and the newest preview now start and open nonempty source without logged errors. This is launch/format operation evidence only; real color/copy/selection acceptance remains pending.

Fresh owner preview: Review-toolbar-splash.md — MarkdownViewr, PID103040, output artifacts/splash-toolbar-review/bin/x64/Release/net10.0-windows10.0.19041.0/MarkdownViewr.Windows.exe. Its separate review profile enables a5000ms splash and Source, and disables startup update checks. Other owner windows were preserved.

Verification: zero-warning/error full Release build;570 core tests pass,100% measured line coverage; formatting and changed-doc lint pass.79 UI-project cases discovered (66desktop/13filesystem; expected78 per installed channel); actual new desktop/distributed acceptance has not run. Launch/document opening succeeded with no warnings in the profile log. Passive Computer Use inspection was unavailable because its native pipe was not found; no mouse/keyboard input occurred.

The original four staged corrections remain unchanged. Signed commits/push still await the pending1Password ready reply; no signing retry, merge, tag, release or Azure change. System Print handoff, PDF open actions, remaining full PRODUCT parity, standards and exact production-signature proof remain open.

Correction to the earlier preview handoff: native startup first failed on unsupported HighContrastChanged event registration, then native formatting failed on the read-only RichEdit document. Replaced registration with marshalled UISettings color changes and wrapped native writes/character formatting in a synchronous guard restoring read-only state before return/yield. Both corrected Review-updated and the newest preview now start and open nonempty source without logged errors. This is launch/format operation evidence only; real color/copy/selection acceptance remains pending. Fresh owner preview: `Review-toolbar-splash.md — MarkdownViewr`, PID103040, output `artifacts/splash-toolbar-review/bin/x64/Release/net10.0-windows10.0.19041.0/MarkdownViewr.Windows.exe`. Its separate review profile enables a5000ms splash and Source, and disables startup update checks. Other owner windows were preserved. Verification: zero-warning/error full Release build;570 core tests pass,100% measured line coverage; formatting and changed-doc lint pass.79 UI-project cases discovered (66desktop/13filesystem; expected78 per installed channel); actual new desktop/distributed acceptance has not run. Launch/document opening succeeded with no warnings in the profile log. Passive Computer Use inspection was unavailable because its native pipe was not found; no mouse/keyboard input occurred. The original four staged corrections remain unchanged. Signed commits/push still await the pending1Password ready reply; no signing retry, merge, tag, release or Azure change. System Print handoff, PDF open actions, remaining full PRODUCT parity, standards and exact production-signature proof remain open.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/MarkdownViewr.Windows#16