Skip to content

Commit

Permalink
fix: crash markdown render code block without triple backtick (#4248)
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur authored Dec 9, 2024
1 parent 2138907 commit 893d6ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -198,12 +199,10 @@ export const MarkdownTextMessage = memo(
remarkPlugins={[remarkMath]}
rehypePlugins={[
[rehypeKatex, { throwOnError: false }],
rehypeRaw,
rehypeHighlight,
[rehypeHighlightCodeLines, { showLineNumbers: true }],
wrapCodeBlocksWithoutVisit,
]}
skipHtml={true}
>
{text}
</Markdown>
Expand Down

0 comments on commit 893d6ff

Please sign in to comment.