Skip to content

Commit 0097e9f

Browse files
committed
fix: remove katex in toc tree
Signed-off-by: Innei <[email protected]>
1 parent c3f5c79 commit 0097e9f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/modules/toc/TocTree.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const TocTree: Component<
7777
return Array.from($headings).map((el, idx) => {
7878
const depth = +el.tagName.slice(1)
7979
const elClone = el.cloneNode(true) as HTMLElement
80-
elClone.querySelectorAll('del').forEach((del) => {
80+
elClone.querySelectorAll('del, .katex-container').forEach((del) => {
8181
del.remove()
8282
})
8383

src/components/ui/markdown/parsers/katex.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ const LateX: FC<LateXProps> = (props) => {
5959
}
6060
}, [])
6161

62-
return <span dangerouslySetInnerHTML={{ __html: html }} />
62+
return (
63+
<span
64+
dangerouslySetInnerHTML={{ __html: html }}
65+
className="katex-container"
66+
/>
67+
)
6368
}
6469

6570
export const KateXBlockRule: MarkdownToJSX.Rule = {

0 commit comments

Comments
 (0)