Encoders & Text

Markdown & Mermaid Viewer

Live Markdown preview with Mermaid diagram rendering and safe HTML export.

  • History kept on this deviceRecent results are kept in this browser's local storage until you clear them.
  • Runs in your browserProcessing happens in this page. No application server receives your input.

Markdown input

HTML preview

Enter Markdown in the editor to render a live sanitized preview.

What this tool does

Renders GitHub-Flavored Markdown (GFM) live as you type with a 300ms preview debounce, extracts ```mermaid fenced blocks during parsing to render diagrams concurrently with securityLevel: strict and htmlLabels: false, sanitizes all HTML through fail-closed DOMPurify and URL attribute policies, isolates Mermaid SVG previews via blob URLs, and exports standalone dark-themed HTML.

Sanitization & diagram pipeline

  • Markdown is parsed with GFM tables, task lists, strikethrough, and fenced code blocks while ```mermaid fences are replaced with scoped placeholders during token rendering.
  • HTML output is sanitized with HTML_CONFIG (forbidding <script>, <style>, <svg>, <iframe>, inline style attributes, event handlers, and dangerous URL schemes across a[href], img[src], source[src], video[src], video[poster], audio[src], use[href], and form[action]).
  • External image URLs (http://, https://, //) are blocked before reaching the live DOM and replaced with a placeholder naming the refused origin so zero network beacons fire (GAP-014).
  • Mermaid diagrams are rendered asynchronously in parallel via Promise.allSettled, passed through sanitizeSvgForPreview, and displayed via IsolatedPreview.

Limits and non-goals

No Markdown extensions beyond GFM: no footnotes, no math, no admonitions, no front matter. Raw HTML in the source is sanitized, so a <style> block or an onclick is removed rather than honored. Diagram types are whatever the pinned Mermaid version supports.

Bundled local resources & release dates

  • mermaid v11.17.2 (released 2026-08-25, MIT, local dynamic bundle) โ€” native diagram & chart layout engine.
  • marked v18.0.11 (released 2026-08-24, MIT, local dynamic bundle) โ€” GitHub-Flavored Markdown parser.
  • dompurify v3.4.17 (released 2026-10-12, MPL-2.0 OR Apache-2.0, local dynamic bundle) โ€” fail-closed HTML and SVG sanitizer.

View full Changelog & External Resources inventory

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.