Merge pull request #4137 from janhq/revert-4134-fix/memory-leak-performance
Revert "fix: memory leak lowlight dependencies"
This commit is contained in:
commit
697fdc235d
@ -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": "^6.0.0",
|
"rehype-highlight": "^7.0.1",
|
||||||
"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",
|
||||||
|
|||||||
@ -95,7 +95,6 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
|
|||||||
// Join the lines with newline characters for proper formatting
|
// Join the lines with newline characters for proper formatting
|
||||||
return codeLines.join('\n')
|
return codeLines.join('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
function wrapCodeBlocksWithoutVisit() {
|
function wrapCodeBlocksWithoutVisit() {
|
||||||
return (tree: { children: any[] }) => {
|
return (tree: { children: any[] }) => {
|
||||||
tree.children = tree.children.map((node) => {
|
tree.children = tree.children.map((node) => {
|
||||||
@ -395,12 +394,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
|
|||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
[rehypeKatex, { throwOnError: false }],
|
[rehypeKatex, { throwOnError: false }],
|
||||||
rehypeRaw,
|
rehypeRaw,
|
||||||
[
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{ subset: false, plainText: ['txt', 'text'] },
|
|
||||||
],
|
|
||||||
[rehypeHighlightCodeLines, { showLineNumbers: true }],
|
[rehypeHighlightCodeLines, { showLineNumbers: true }],
|
||||||
wrapCodeBlocksWithoutVisit,
|
wrapCodeBlocksWithoutVisit,
|
||||||
]}
|
]}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user