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
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>