chore: update latex language for rehype-highlight (#4144)
This commit is contained in:
parent
8642588694
commit
1a824f0162
@ -37,7 +37,7 @@
|
|||||||
"react-icons": "^4.12.0",
|
"react-icons": "^4.12.0",
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
"react-toastify": "^9.1.3",
|
"react-toastify": "^9.1.3",
|
||||||
"rehype-highlight": "^7.0.1",
|
"rehype-highlight": "^6.0.0",
|
||||||
"rehype-highlight-code-lines": "^1.0.4",
|
"rehype-highlight-code-lines": "^1.0.4",
|
||||||
"rehype-katex": "^7.0.1",
|
"rehype-katex": "^7.0.1",
|
||||||
"rehype-raw": "^7.0.0",
|
"rehype-raw": "^7.0.0",
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import {
|
|||||||
|
|
||||||
import { Tooltip } from '@janhq/joi'
|
import { Tooltip } from '@janhq/joi'
|
||||||
|
|
||||||
|
import latex from 'highlight.js/lib/languages/latex'
|
||||||
import { useAtomValue } from 'jotai'
|
import { useAtomValue } from 'jotai'
|
||||||
import { FolderOpenIcon } from 'lucide-react'
|
import { FolderOpenIcon } from 'lucide-react'
|
||||||
import rehypeHighlight from 'rehype-highlight'
|
import rehypeHighlight from 'rehype-highlight'
|
||||||
@ -394,7 +395,16 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
|
|||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
[rehypeKatex, { throwOnError: false }],
|
[rehypeKatex, { throwOnError: false }],
|
||||||
rehypeRaw,
|
rehypeRaw,
|
||||||
rehypeHighlight,
|
[
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
rehypeHighlight,
|
||||||
|
{
|
||||||
|
languages: { latex },
|
||||||
|
subset: false,
|
||||||
|
plainText: ['txt', 'text'],
|
||||||
|
},
|
||||||
|
],
|
||||||
[rehypeHighlightCodeLines, { showLineNumbers: true }],
|
[rehypeHighlightCodeLines, { showLineNumbers: true }],
|
||||||
wrapCodeBlocksWithoutVisit,
|
wrapCodeBlocksWithoutVisit,
|
||||||
]}
|
]}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user