Plugins

Extend Comark with powerful plugins for syntax highlighting, emojis, table of contents, math equations, diagrams, and more.

Comark's plugin system extends markdown functionality with specialized features. All plugins are part of the core comark package.

Plugins

Security

Sanitize markdown by removing dangerous HTML elements and attributes

Emoji

Convert emoji shortcodes like :smile: into emoji characters

Syntax Highlighting

Beautiful code syntax highlighting using Shiki with multi-theme support

Summary

Extract content summaries using <!-- more --> delimiter

Table of Contents

Generate hierarchical TOC from headings automatically

Alerts

Render GitHub-style alert blockquotes with icons and colors

Task List

Render interactive checkboxes from [ ] and [x] list syntax

Mermaid

Create diagrams and visualizations using Mermaid syntax in code blocks

Math

Render LaTeX math formulas using KaTeX with inline and display equations

Use Plugins

Pass plugins to parse() or the <Comark> component:

import { parse } from 'comark'
import emoji from 'comark/plugins/emoji'
import toc from 'comark/plugins/toc'

const result = await parse(content, {
  plugins: [
    emoji(),
    toc({ depth: 3 })
  ]
})
Copyright © 2026