feat(changes): render mermaid fences in the reading mode via the shared lazy chunk
Documents containing mermaid fences now route through the editor preview chunk-resident renderer (splitMermaidBlocks detection + LazyMermaidMarkdown), so diagrams draw with zoom/pan instead of code blocks, while plain documents keep the byte-for-byte single MarkdownText pass. The lazy stub moves to a light mermaid-lazy.tsx module (re-exported from MarkdownHtml.tsx) so the core client bundle imports it without statically pulling DOMPurify/HTML analysis along. Typecheck, 4 affected suites (22 tests), and the full build pass.
This commit is contained in:
@@ -31,11 +31,11 @@ import type { SessionScope } from './api.ts'
|
||||
import css from './sidebar.module.css'
|
||||
|
||||
/** The chunk-resident markdown renderer (mermaid lazy chunk), shared with the
|
||||
* legacy no-HTML preview path in TextEditor. */
|
||||
export const LazyMermaidMarkdown = lazyChunkComponent<MermaidMarkdownProps>(
|
||||
'mermaid',
|
||||
(mod) => mod.MermaidMarkdown as ComponentType<MermaidMarkdownProps> | undefined,
|
||||
)
|
||||
* legacy no-HTML preview path in TextEditor. Defined in mermaid-lazy.tsx (a
|
||||
* light module) so core-bundle consumers can import the stub without
|
||||
* dragging DOMPurify along. */
|
||||
export { LazyMermaidMarkdown } from './mermaid-lazy.tsx'
|
||||
import { LazyMermaidMarkdown } from './mermaid-lazy.tsx'
|
||||
|
||||
/** Everything the sanitizers need to resolve local media + scope the route. */
|
||||
export interface MarkdownHtmlMedia {
|
||||
|
||||
Reference in New Issue
Block a user