vsmarkdown-it.
Raw Parser vs Svelte Component
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.
side-by-side.
Every surface that matters, compared without spin.
| feature | @humanspeak/svelte-markdown | markdown-it |
|---|---|---|
| Svelte 5 Native | yes | no |
| TypeScript Support | yes | @types/markdown-it |
| Component Output | Svelte components | Raw HTML string |
| Custom Renderers | Svelte components | Token stream manipulation |
| Token Caching | yes | no |
| HTML Safety | Allow/deny per tag | Manual (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> arrives | no |
| Plugin Ecosystem | Via marked extensions | 200+ 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 component | Framework-agnostic (requires {@html}) |
where each shines.
- +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
- +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
where each falls short.
- −Smaller community (newer project)
- −Runtime-only (no build-time optimization)
- −Fewer plugins than markdown-it ecosystem
- −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
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.
read more.
Every head-to-head, with the same matrix + pros / cons + verdict format.
Build-Time Preprocessor vs Runtime Component
read comparison ↗Heavyweight Editor vs Lightweight Renderer
read comparison ↗The Engine Under Our Hood
read comparison ↗Plugin-Driven Editor vs Focused Renderer
read comparison ↗Two Runtime Renderers, Different Engines
read comparison ↗Editor + Viewer vs Pure Renderer
read comparison ↗Full Editor vs Pure Renderer
read comparison ↗AST Pipeline vs Component Renderer
read comparison ↗Editor Toolkit vs Ready-Made Renderer
read comparison ↗The full /compare index — every head-to-head in one place.
browse all ↗svelte markdown → install in 30 seconds