Skip to content

Commit

Permalink
fix: memory leak lowlight dep
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Nov 26, 2024
1 parent b046ee3 commit bf9bdde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-icons": "^4.12.0",
"react-markdown": "^9.0.1",
"react-toastify": "^9.1.3",
"rehype-highlight": "^7.0.1",
"rehype-highlight": "^6.0.0",
"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,6 +95,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
// Join the lines with newline characters for proper formatting
return codeLines.join('\n')

Check warning on line 96 in web/screens/Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

96 line is not covered with tests
}

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

0 comments on commit bf9bdde

Please sign in to comment.