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

vsmarked.

The Engine Under Our Hood

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

at a glance.

Compare marked and @humanspeak/svelte-markdown: direct markdown parsing versus a Svelte 5 component layer with renderers, caching, and safety controls.

FIG-003 / FEATURE MATRIX

side-by-side.

Every surface that matters, compared without spin.

feature@humanspeak/svelte-markdownmarked
Svelte 5 Native yesno
TypeScript Support yesyes
Component Output Svelte componentsRaw HTML string
Custom Renderers Svelte componentsToken manipulation
Token Caching Built-in LRU cacheManual implementation
HTML Safety Allow/deny per tagManual sanitization
LLM Streaming Mode marked is the parsing engine only; incremental streaming behavior must be built manually on top.writeChunk() / resetStream()no
Streaming HTML Output marked parses to tokens or HTML strings per call; streaming reconciliation of nested HTML across chunks is left to the consumer.Partial blocks reconcile when </tag> arrivesno
Extensions Full marked extensions supportFull extensions API
Math (KaTeX) Built-in extension (markedKatex)Via marked-katex-extension
Diagrams (Mermaid) Built-in extension (markedMermaid)Via marked-mermaid
GitHub Alerts Built-in extension (markedAlert)Via marked-alert
Footnotes Built-in extension (markedFootnote)Via marked-footnote
GFM Support yesyes
Bundle Size ~15KB (includes marked)~8KB (parser only)
Framework Integration Native SvelteRequires {@html}
FIG-004 / STRENGTHS

where each shines.

▣ svelte markdown 12
  • +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
  • +All the power of marked, wrapped in Svelte components
  • +Full marked extensions API pass-through
  • +No {@html} needed — renders as safe Svelte components
▢ marked 5
  • +Most popular JS markdown parser (38M+ weekly npm downloads)
  • +Smaller bundle (parser only, no rendering layer)
  • +Framework-agnostic — use anywhere
  • +Maximum flexibility with token/renderer hooks
  • +Extensive extension ecosystem
FIG-005 / LIMITATIONS

where each falls short.

▣ svelte markdown 3
  • Smaller community (newer project)
  • Runtime-only (no build-time optimization)
  • Slightly larger bundle (includes rendering layer on top of marked)
▢ marked 4
  • Outputs raw HTML — requires {@html} and manual XSS handling
  • No component-based rendering in Svelte
  • Must manually implement caching
  • No allow/deny controls for HTML tags
FIG-006 / VERDICT

the honest call.

We use marked internally — so you get all of its parsing power for free. Choose marked directly when you need a framework-agnostic parser or want the absolute smallest bundle. Choose @humanspeak/svelte-markdown when you want the Svelte DX layer: component rendering, caching, HTML controls, and TypeScript types.

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