AKARI-Markdown.js

A robust, Shadow DOM encapsulated Markdown renderer Web Component with built-in Mermaid, Math (KaTeX), and syntax highlighting support.

Live Demo Documentation View on GitHub

Shadow DOM Isolation

Styles are completely encapsulated. Your Markdown content won't bleed styles into your app, and your app CSS won't break the rendered content.

Mermaid & Charts

Built-in support for mermaid diagrams. Includes fixes for rendering integrity, streaming detection, and automatic error handling.

Math Support

Renders math equations elegantly using KaTeX. Supports both inline $E=mc^2$ and block $$...$$ syntax.

Syntax Highlighting

Integrated highlight.js for beautiful code blocks with automatic language detection and dark mode support.

Streaming Ready

Designed for LLM outputs. It detects incomplete code blocks and shows a "typing" cursor animation for unclosed tags.

Easy to Use

Just import the JS file and use the <akari-markdown> tag. No complex build step required.