Skip to content

Commit

Permalink
Merge pull request janhq#4137 from janhq/revert-4134-fix/memory-leak-…
Browse files Browse the repository at this point in the history
…performance

Revert "fix: memory leak lowlight dependencies"
  • Loading branch information
louis-jan authored Nov 27, 2024
2 parents bff0a3a + 0033c7c commit 697fdc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"react-icons": "^4.12.0",
"react-markdown": "^9.0.1",
"react-toastify": "^9.1.3",
"rehype-highlight": "^6.0.0",
"rehype-highlight": "^7.0.1",
"rehype-highlight-code-lines": "^1.0.4",
"rehype-katex": "^7.0.1",
"rehype-raw": "^7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
// Join the lines with newline characters for proper formatting
return codeLines.join('\n')
}

function wrapCodeBlocksWithoutVisit() {
return (tree: { children: any[] }) => {
tree.children = tree.children.map((node) => {
Expand Down Expand Up @@ -395,12 +394,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
rehypePlugins={[
[rehypeKatex, { throwOnError: false }],
rehypeRaw,
[
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
rehypeHighlight,
{ subset: false, plainText: ['txt', 'text'] },
],
rehypeHighlight,
[rehypeHighlightCodeLines, { showLineNumbers: true }],
wrapCodeBlocksWithoutVisit,
]}
Expand Down

0 comments on commit 697fdc2

Please sign in to comment.