A high-performance markdown parser and renderer with Vue & React components support.
- 🚀 Fast markdown-exit based parser
- 📦 Stream API for buffered parsing
- 🔧 Comark component syntax support
- 🔒 Auto-close unclosed markdown syntax (perfect for streaming)
- 📝 Frontmatter parsing (YAML)
- 📑 Automatic table of contents generation
- 🎯 Full TypeScript support
npm install comark
# or
pnpm add comark<script setup lang="ts">
import { Comark } from 'comark/vue'
import cjk from '@comark/cjk'
import math from '@comark/math'
import { Math } from '@comark/math/vue'
const chatMessage = ...
</script>
<template>
<Comark :components="{ Math }" :plugins="[cjk(), math()]">{{ chatMessage }}</Comark>
</template>import { Comark } from 'comark/react'
import cjk from '@comark/cjk'
import math from '@comark/math'
import { Math } from '@comark/math/react'
function App() {
const chatMessage = ...
return <Comark components={{ Math }} plugins={[cjk(), math()]}>{chatMessage}</Comark>
}Made with ❤️
Published under MIT License.