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. Plugins can add new syntax, transform content, or enhance rendering.
Core Plugins
Core plugins are built-in and part of the main comark package:
External Plugins
External plugins are separate packages that extend Comark with specialized features:
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 })
]
})
<script setup lang="ts">
import { Comark } from 'comark/vue'
import emoji from 'comark/plugins/emoji'
</script>
<template>
<Comark :plugins="[emoji()]">{{ content }}</Comark>
</template>
import { Comark } from 'comark/react'
import emoji from 'comark/plugins/emoji'
<Comark plugins={[emoji()]}>{content}</Comark>