<!-- Source: https://markdown.svelte.page/compare/vs-svelte-exmarkdown -->
<!-- Canonical: https://markdown.svelte.page/compare/vs-svelte-exmarkdown -->
# Svelte Markdown vs svelte-exmarkdown

Two Runtime Renderers, Different Engines

## Overview

Compare svelte-exmarkdown and @humanspeak/svelte-markdown: unified-based runtime rendering versus marked-powered Svelte 5 renderers and streaming support.

- **Svelte Markdown site:** https://markdown.svelte.page
- **Svelte Markdown npm:** https://www.npmjs.com/package/%40humanspeak%2Fsvelte-markdown
- **Svelte Markdown slug:** svelte-markdown
- **Category:** Runtime Renderer
- **Approach:** unified/remark/rehype pipeline
- **GitHub:** https://github.com/ssssota/svelte-exmarkdown
- **npm:** https://www.npmjs.com/package/svelte-exmarkdown

## Feature comparison

| Feature | @humanspeak/svelte-markdown | svelte-exmarkdown | Notes |
| --- | --- | --- | --- |
| Svelte 5 Compatibility | Yes | Yes |  |
| TypeScript Support | Yes | Yes |  |
| Parsing Engine | marked | unified/remark/rehype |  |
| Custom Renderers | Yes | Yes |  |
| Token Caching | Built-in LRU cache | No |  |
| HTML Tag Control | 83 tags with allow/deny | Via rehype plugins |  |
| LLM Streaming Mode | writeChunk() / resetStream() | No | svelte-exmarkdown is a runtime renderer, but its upstream docs do not describe a streaming-specific incremental mode. |
| Streaming HTML Output | Partial blocks reconcile when </tag> arrives | No | No documented streaming pipeline; partial HTML blocks during streaming aren’t reconciled into nested structures. |
| Plugin System | Marked extensions | Remark/rehype plugins |  |
| Snippet Overrides | Yes | No |  |
| HTML Renderers | 83 dedicated components | Generic element handling |  |
| Math (KaTeX) | Built-in extension (markedKatex) | Via remark-math + rehype-katex |  |
| Diagrams (Mermaid) | Built-in extension (markedMermaid) | Via rehype-mermaid |  |
| Dependency Surface | marked-based renderer | unified + remark + rehype pipeline |  |
| Marked Extensions | Yes | No |  |

## Svelte Markdown strengths

- 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
- 24 markdown renderers + 83 HTML tag renderers — every override is a Svelte snippet
- First-class extensions: KaTeX math, Mermaid diagrams, GitHub alerts, footnotes
- Opt-in Shiki syntax highlighting (streaming-compatible, tree-shaken from core)
- 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
- Svelte 5 snippet overrides — customize rendering inline
- 83 dedicated HTML tag renderers (not generic)
- Smaller bundle — marked is lighter than unified stack

## svelte-exmarkdown strengths

- Built on unified ecosystem — access to hundreds of remark/rehype plugins
- AST-level transformation capabilities
- Plugin architecture designed for extensibility
- Active maintenance and Svelte 5 support

## Svelte Markdown limitations

- Smaller community (newer project)
- Runtime-only (no build-time optimization)
- No direct access to remark/rehype plugin ecosystem

## svelte-exmarkdown limitations

- No built-in token caching
- Larger bundle (unified + remark + rehype)
- No snippet override support
- Fewer dedicated HTML tag renderers

## Verdict

Choose svelte-exmarkdown if you are invested in the unified/remark/rehype ecosystem and need specific plugins from that world. Choose @humanspeak/svelte-markdown for a lighter, faster option with built-in caching, snippet overrides, and comprehensive HTML tag handling.

## Keywords

svelte exmarkdown, svelte markdown component, svelte-exmarkdown vs svelte-markdown
