Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
@cixzhang — I’d appreciate your feedback on this draft. Focus: Hosts that render the same parsed Markdown in multiple places can prepare it once and reuse the exact canonical document and Outline projection. This is PR 4/20 in the linked Markdown stack. It is intentionally one commit and one primary intent; the description includes focused functional evidence and previous/next links, so you can review just this PR’s delta. |
humbertovirtudes
left a comment
There was a problem hiding this comment.
prepareMarkdownDocument() promises an immutable snapshot, but the public root remains mutable while only the outer document and outline are frozen. A consumer can mutate nested nodes after heading projection, causing rendered content to diverge from document.outline and the retained heading-ID map. Please deep-freeze the complete root at the preparation boundary and add a nested-mutation regression covering Markdown and Outline parity.
PR Analysis Report
Modified ComponentsOutline (@astryxdesign/core)
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression2 added · 2 removed. Generated by PR Enrichment workflow | View full report |
User need
Hosts that render the same parsed Markdown in multiple places can prepare it once and reuse the exact canonical document and Outline projection.
Problem and solution fit
String-only rendering repeated parsing and transform work and left hosts to coordinate independently derived Outline data. An opaque prepared value makes that reuse explicit while preventing incompatible inline or streaming combinations.
Current specification
The prepared-document requirement in the Markdown component contract and AST-036's canonical document model. Pinned source.
Public delta and caller burden
Export
prepareMarkdownDocument()and a block-onlydocumentinput, preserve opaque validation, and let Outline consume the readonly projected items without copying.Design and alternatives
The capability is explicit and opt-in where it changes syntax, rendering, or package weight. Existing defaults and replacement seams remain compatible; broader alternatives stay outside this PR.
Evidence
Functional evidence
This change is intentionally nonvisual; a pixel comparison would be misleading.
Focused behavior and compatibility coverage ships with the implementation.
Scope
Testing
pnpm exec vitest run packages/core/src/Markdown packages/core/src/CodeBlock— 37 files, 760 tests.pnpm --filter @astryxdesign/core typecheck.pnpm check:repo.Stack
Previous: #6658 · Next: #6660 · Each PR is intentionally one commit and one primary intent.