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

vsmarkdown-it.

Raw Parser vs Svelte Component

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

at a glance.

Compare markdown-it and @humanspeak/svelte-markdown: raw HTML string parsing versus typed Svelte 5 renderers with caching, snippets, and HTML control.

FIG-003 / FEATURE MATRIX

side-by-side.

Every surface that matters, compared without spin.

feature@humanspeak/svelte-markdownmarkdown-it
Svelte 5 Native yesno
TypeScript Support yes@types/markdown-it
Component Output Svelte componentsRaw HTML string
Custom Renderers Svelte componentsToken stream manipulation
Token Caching yesno
HTML Safety Allow/deny per tagManual (use with {@html})
LLM Streaming Mode markdown-it is a parser, not a streaming UI layer.writeChunk() / resetStream()no
Streaming HTML Output Each parse returns a full HTML string — reconciling partial <tag>...</tag> structures across chunks is the caller’s responsibility.Partial blocks reconcile when </tag> arrivesno
Plugin Ecosystem Via marked extensions200+ plugins
CommonMark Compliance Via marked (GFM)100% CommonMark + extensions
XSS Protection Built-in (URL allowlist + attr sanitization)Manual sanitization required
Math (KaTeX) Built-in extension (markedKatex)Via markdown-it-katex plugin
GitHub Alerts Built-in extension (markedAlert)Via plugin
Footnotes Built-in extension (markedFootnote)Via markdown-it-footnote plugin
Framework Integration Native Svelte componentFramework-agnostic (requires {@html})
FIG-004 / STRENGTHS

where each shines.

▣ svelte markdown 11
  • +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 as Svelte components — not raw HTML injection
  • +No need for {@html} and manual sanitization
▢ markdown-it 5
  • +Massive ecosystem (21M+ weekly npm downloads)
  • +100% CommonMark compliant with spec test suite
  • +200+ community plugins available
  • +Framework-agnostic — use anywhere
  • +Battle-tested in production at scale
FIG-005 / LIMITATIONS

where each falls short.

▣ svelte markdown 3
  • Smaller community (newer project)
  • Runtime-only (no build-time optimization)
  • Fewer plugins than markdown-it ecosystem
▢ markdown-it 4
  • Outputs raw HTML strings — requires {@html} in Svelte
  • No built-in XSS protection — manual sanitization needed
  • No Svelte component integration — cannot use Svelte renderers
  • No caching layer — re-parses every render
FIG-006 / VERDICT

the honest call.

Choose markdown-it when you need a framework-agnostic parser with maximum CommonMark compliance and a vast plugin ecosystem. Choose @humanspeak/svelte-markdown when you want a native Svelte experience with component-based rendering, built-in safety controls, and caching.

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