在vue-markdown-render中解析LaTeX公式

<VueMarkdown
   :options="{
     html: true
   }"
   :plugins="markdownPlugins"
   class="markdown"
   :source="message.content"
/>
import texmath from 'markdown-it-texmath'
import * as katex from 'katex'

const markdownPlugins = [
  (md: any) =>
    md.use(texmath, {
      engine: katex,
      delimiters: 'brackets',
      katexOptions: { throwOnError: false, strict: 'ignore' }
    })
]

 

posted @ 2025-10-28 18:49  随风&  阅读(11)  评论(0)    收藏  举报