feat: enable Math support in Markdown rendering.

- Enabled Math support in Markdown rendering without single dollar text math.
This commit is contained in:
kangfenmao 2024-09-10 15:31:32 +08:00
parent a3f5223b4c
commit 10b4e3c634

View File

@ -31,7 +31,7 @@ const Markdown: FC<Props> = ({ message }) => {
<ReactMarkdown <ReactMarkdown
className="markdown" className="markdown"
rehypePlugins={[rehypeKatex]} rehypePlugins={[rehypeKatex]}
remarkPlugins={[[remarkMath, { singleDollarTextMath: false }], remarkGfm]} remarkPlugins={[remarkMath, remarkGfm]}
remarkRehypeOptions={{ remarkRehypeOptions={{
footnoteLabel: t('common.footnotes'), footnoteLabel: t('common.footnotes'),
footnoteLabelTagName: 'h4', footnoteLabelTagName: 'h4',