Plugin options
markdown-it-mermaid-enhanced keeps the public option surface intentionally small
MermaidItOptions
| Field | Type | Default | Notes |
|---|---|---|---|
theme | 'auto' | 'default' | 'dark' | 'forest' | 'neutral' | 'base' | 'auto' | auto follows system dark mode |
renderEngine | 'mermaidjs' | 'excalidraw' | 'mermaidjs' | Selects the renderer behind the wrapper |
sketch | boolean | false | Enables Mermaid sketch mode |
fontFamily | string | '' | Standard font family override |
sketchFont | string | '' | Sketch font family override and implicit sketch enable |
minHeight | string | '' | Plugin-level minimum height fallback |
mermaidConfig | Record<string, unknown> | {} | Extra Mermaid config merged into Mermaid.js rendering |
excalidrawConfig | MermaidToExcalidrawConfig | {} | Supported conversion config for Excalidraw mode |
MermaidToExcalidrawConfig
| Field | Type | Notes |
|---|---|---|
startOnLoad | boolean | Forwarded to the conversion layer |
flowchart.curve | 'linear' | 'basis' | Flowchart edge curve |
themeVariables.fontSize | string | Font size used during conversion |
maxEdges | number | Limits edge count |
maxTextSize | number | Limits text payload size |
A compact example
ts
import MarkdownIt from 'markdown-it'
import markdownItMermaidEnhanced from 'markdown-it-mermaid-enhanced'
const markdown = new MarkdownIt().use(markdownItMermaidEnhanced, {
theme: 'auto',
renderEngine: 'mermaidjs',
sketch: true,
sketchFont: '"Excalifont"',
minHeight: '160px',
})