fix: LaTex formula render issue (#3353)

This commit is contained in:
Louis 2024-08-13 10:04:24 +07:00 committed by GitHub
parent 6dd387db2b
commit 3b2c84c4fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { PropsWithChildren } from 'react'
import { Metadata } from 'next'
import 'katex/dist/katex.min.css'
import '@/styles/main.scss'
export const metadata: Metadata = {

View File

@ -7,7 +7,7 @@ import hljs from 'highlight.js'
import { useAtomValue } from 'jotai'
import { FolderOpenIcon } from 'lucide-react'
import { Marked, Renderer } from 'marked'
import { Marked, MarkedOptions, Renderer } from 'marked'
import { markedHighlight } from 'marked-highlight'
import markedKatex from 'marked-katex-extension'
@ -86,6 +86,8 @@ const SimpleTextMessage: React.FC<Props> = ({
},
}),
{
gfm: true,
breaks: true,
renderer: {
link: (href, title, text) =>
Renderer.prototype.link