vsmarked.
The Engine Under Our Hood
at a glance.
Compare marked and @humanspeak/svelte-markdown: direct markdown parsing versus a Svelte 5 component layer with renderers, caching, and safety controls.
side-by-side.
Every surface that matters, compared without spin.
| feature | @humanspeak/svelte-markdown | marked |
|---|---|---|
| Svelte 5 Native | yes | no |
| TypeScript Support | yes | yes |
| Component Output | Svelte components | Raw HTML string |
| Custom Renderers | Svelte components | Token manipulation |
| Token Caching | Built-in LRU cache | Manual implementation |
| HTML Safety | Allow/deny per tag | Manual 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> arrives | no |
| Extensions | Full marked extensions support | Full 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 | yes | yes |
| Bundle Size | ~15KB (includes marked) | ~8KB (parser only) |
| Framework Integration | Native Svelte | 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
- +All the power of marked, wrapped in Svelte components
- +Full marked extensions API pass-through
- +No {@html} needed — renders as safe Svelte components
- +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
where each falls short.
- −Smaller community (newer project)
- −Runtime-only (no build-time optimization)
- −Slightly larger bundle (includes rendering layer on top of marked)
- −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
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.
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 ↗Raw Parser vs Svelte Component
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