FIG-001 · MASTHEAD
// compare / svelte-markdown vs vs-mdsvex

vsmdsvex.

Build-Time Preprocessor vs Runtime Component

FIG-001
SHEET 01 / 07
FIG-002 / OVERVIEW

at a glance.

Compare MDsveX and @humanspeak/svelte-markdown: build-time .svx preprocessing versus runtime Svelte 5 markdown rendering, caching, and HTML control.

FIG-003 / FEATURE MATRIX

side-by-side.

Every surface that matters, compared without spin.

feature@humanspeak/svelte-markdownMDsveX
Svelte 5 Native yesyes
TypeScript Support yesPartial
Runtime Rendering MDsveX is build-time onlyyesno
Dynamic Content Cannot render user-supplied markdownyesno
Custom Renderers yesyes
Token Caching Not needed — parsed at build timeyesno
LLM Streaming Mode MDsveX is build-time only, so there is no runtime markdown streaming mode.writeChunk() / resetStream()no
Streaming HTML Output MDsveX compiles at build time — there is no runtime stream that could resolve partial HTML blocks across chunks.Partial blocks reconcile when </tag> arrivesno
HTML Tag Control 84 tags with allow/denyVia rehype plugins
Markdown in Components yesyes
Components in Markdown noyes
Frontmatter MDsveX has built-in frontmatter parsingnoyes
Math (KaTeX) Built-in extension (markedKatex)Via remark-math + rehype-katex
Diagrams (Mermaid) Built-in extension (markedMermaid)Via rehype-mermaid
GitHub Alerts Built-in extension (markedAlert)Via remark-github-alerts
Code Highlighting Via marked extensionsBuilt-in (Shiki/Prism)
Remark/Rehype Plugins noyes
FIG-004 / STRENGTHS

where each shines.

▣ svelte markdown 13
  • +Svelte 5 runes-native — built for runes, not retrofitted
  • +TypeScript-first with full type safety
  • +Built-in token caching (50-200x faster re-renders on repeated content)
  • +LLM streaming with imperative writeChunk() / resetStream() API
  • +23 markdown renderers + 84 HTML tag renderers — every override is a Svelte snippet
  • +First-class extensions: KaTeX math, Mermaid diagrams, GitHub alerts, footnotes
  • +Built-in XSS protection — protocol allowlist, event-handler stripping, attribute sanitization
  • +Allow/deny utilities (allowHtmlOnly, excludeRenderersOnly, etc.) for fine-grained control
  • +Drop-in component — works anywhere in your Svelte app
  • +Renders dynamic/user-supplied markdown at runtime
  • +No build step required — works with any markdown string
  • +Math, Mermaid, alerts, and footnotes ship as first-class extensions — no remark/rehype pipeline required
  • +Simpler mental model — just pass a string, get rendered output
▢ mdsvex 6
  • +Largest Svelte markdown ecosystem (~3,000 GitHub stars)
  • +Build-time optimization — zero runtime parsing cost
  • +Use Svelte components directly inside markdown files
  • +Rich plugin ecosystem via unified/remark/rehype
  • +Built-in code syntax highlighting
  • +Frontmatter parsing out of the box
FIG-005 / LIMITATIONS

where each falls short.

▣ svelte markdown 5
  • Smaller community (newer project)
  • Runtime-only (no build-time optimization)
  • Cannot embed Svelte components inside markdown content
  • No frontmatter support (parse separately if needed)
  • No built-in code syntax highlighting (use a marked extension)
▢ mdsvex 4
  • Cannot render dynamic/user-supplied markdown
  • Content must exist at build time as .svx files
  • Adds build complexity (preprocessor configuration)
  • Not suitable for CMS content, user input, or API-fetched markdown
FIG-006 / VERDICT

the honest call.

Choose MDsveX for static content sites, blogs, and documentation where markdown is known at build time. Choose @humanspeak/svelte-markdown when you need to render dynamic markdown — CMS content, user input, API responses, or any scenario where the markdown string is not known until runtime.

FIG-007 / MORE

read more.

Every head-to-head, with the same matrix + pros / cons + verdict format.

SET / JETBRAINS MONO + INTER
HUMANSPEAK · 2026
MIT LICENCE
try
svelte markdowninstall in 30 seconds
SHEET 07 / 07
END OF DOCUMENT
↩ ALL COMPARISONS