Skip to content

fix(editor): refresh deferred Markdown rendering - #641

Merged
murongg merged 2 commits into
v2from
fix/deferred-code-block-rendering
Aug 4, 2026
Merged

fix(editor): refresh deferred Markdown rendering#641
murongg merged 2 commits into
v2from
fix/deferred-code-block-rendering

Conversation

@murongg

@murongg murongg commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • refresh parser-dependent UI when CodeMirror background parsing advances without changing Markdown
  • cover code block chrome, Mermaid, raw HTML, math and footnote exclusions, block toolbars, fold controls, table merge controls, heading controls, and spellcheck
  • centralize syntax-tree identity checks while preserving existing plain-text input fast paths
  • add synthetic long-document regression coverage for all deferred parsing paths

Why

CodeMirror initially parses only part of a long document. Several state fields and view plugins cached results from that partial syntax tree but refreshed only after document edits or other UI events. This could leave later Mermaid and raw HTML source unrendered, clip code block chrome, show math or footnotes inside code fences, omit block controls, or retain spellcheck matches inside code.

Validation

  • pnpm --filter @markra/editor test — 36 files and 440 tests passed
  • pnpm --filter @markra/editor build — passed
  • pnpm --filter @markra/editor typecheck:test — passed
  • pnpm --filter @markra/app test -- src/components/CodeMirrorPaperSurface.test.tsx src/styles.test.ts — 2 files and 99 tests passed
  • pnpm --filter @markra/app build — passed
  • pnpm --filter @markra/app typecheck:test — passed
  • local browser QA with a 46 KB Markdown document confirmed deferred Mermaid SVG rendering and complete rounded code block chrome

Risk

  • low: refreshes are limited to syntax-tree identity changes, ordinary typing keeps the existing mapping fast paths, and spellcheck keeps its existing debounce

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview Aug 4, 2026 2:56am

@murongg murongg changed the title fix(editor): refresh deferred code block rendering fix(editor): refresh deferred Markdown rendering Aug 4, 2026
@murongg
murongg merged commit c642fe0 into v2 Aug 4, 2026
21 checks passed
@murongg
murongg deleted the fix/deferred-code-block-rendering branch August 4, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant