markdown.ts 348 B

123456789101112131415
  1. import MarkdownIt from 'markdown-it'
  2. import mk from './plugin/markdown-it-katex'
  3. import highlight from './plugin/highlight'
  4. const options: MarkdownIt.Options = {
  5. html: true,
  6. highlight
  7. }
  8. export default function () {
  9. const md = MarkdownIt(options)
  10. md.use(mk, { throwOnError: false, errorColor: ' #cc0000', strict: 'error' })
  11. return md
  12. }