You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #60 (#49) introduced behavior specs for the markdown preview as Storybook browser tests (markdown-preview.stories.tsx): XSS sanitization, mermaid rendering (incl. label text), and a small safe-content sample (hljs, links, GFM task lists, KaTeX). That covers the security surface, but the preview enables many more features that have zero automated coverage — any pipeline/schema change could silently break them.
Text decorations (rehypeTextDecorations — underline/marks/etc.)
Code fences in several languages → hljs + language-* classes present
Heading ids from rehypeSlug + MarkdownToc entries matching
Images (http[s] src allowed by schema) + relative-link handling
Mermaid: sequence, class, state, gantt, pie, mindmap — each renders svg with visible label text (flowchart already covered; other diagram families use different label paths — this is where htmlLabels/foreignObject regressions would hide)
Acceptance criteria
All stories green under pnpm exec vitest run --project storybook
Context
PR #60 (#49) introduced behavior specs for the markdown preview as Storybook browser tests (
markdown-preview.stories.tsx): XSS sanitization, mermaid rendering (incl. label text), and a small safe-content sample (hljs, links, GFM task lists, KaTeX). That covers the security surface, but the preview enables many more features that have zero automated coverage — any pipeline/schema change could silently break them.Enabled today (see
MarkdownPreview.tsx+docs/client/markdown-preview-sanitization.md): remarkTypographer, remarkGfm, remarkMath, remarkEmoji, rehypeTextDecorations, rehypeSupSub, rehypeKatex, rehypeHighlight, rehypeSlug, mermaid (decoupled renderer).Scope
One story per feature family (or a matrix story), each asserting the feature renders and survives sanitization:
$$...$$) via KaTeXrehypeSupSubsyntax)rehypeTextDecorations— underline/marks/etc.)hljs+language-*classes presentrehypeSlug+MarkdownTocentries matchingAcceptance criteria
pnpm exec vitest run --project storybookdocs/client/markdown-preview-sanitization.mdtesting section)Related: #49, PR #60