fix: crash markdown render code block without triple backtick (#4248)
This commit is contained in:
parent
21389070fb
commit
893d6ff40e
@ -41,7 +41,6 @@
|
||||
"rehype-highlight": "^7.0.1",
|
||||
"rehype-highlight-code-lines": "^1.0.4",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-raw": "^7.0.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"sass": "^1.69.4",
|
||||
"slate": "latest",
|
||||
|
||||
@ -7,8 +7,9 @@ import Markdown from 'react-markdown'
|
||||
|
||||
import rehypeHighlight from 'rehype-highlight'
|
||||
import rehypeHighlightCodeLines from 'rehype-highlight-code-lines'
|
||||
|
||||
import rehypeKatex from 'rehype-katex'
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
|
||||
import remarkMath from 'remark-math'
|
||||
|
||||
import 'katex/dist/katex.min.css'
|
||||
@ -198,12 +199,10 @@ export const MarkdownTextMessage = memo(
|
||||
remarkPlugins={[remarkMath]}
|
||||
rehypePlugins={[
|
||||
[rehypeKatex, { throwOnError: false }],
|
||||
rehypeRaw,
|
||||
rehypeHighlight,
|
||||
[rehypeHighlightCodeLines, { showLineNumbers: true }],
|
||||
wrapCodeBlocksWithoutVisit,
|
||||
]}
|
||||
skipHtml={true}
|
||||
>
|
||||
{text}
|
||||
</Markdown>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user