Skip to content

Commit

Permalink
fix: remove katex in toc tree
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jun 12, 2024
1 parent c3f5c79 commit 0097e9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/modules/toc/TocTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const TocTree: Component<
return Array.from($headings).map((el, idx) => {
const depth = +el.tagName.slice(1)
const elClone = el.cloneNode(true) as HTMLElement
elClone.querySelectorAll('del').forEach((del) => {
elClone.querySelectorAll('del, .katex-container').forEach((del) => {
del.remove()
})

Expand Down
7 changes: 6 additions & 1 deletion src/components/ui/markdown/parsers/katex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ const LateX: FC<LateXProps> = (props) => {
}
}, [])

return <span dangerouslySetInnerHTML={{ __html: html }} />
return (
<span
dangerouslySetInnerHTML={{ __html: html }}
className="katex-container"
/>
)
}

export const KateXBlockRule: MarkdownToJSX.Rule = {
Expand Down

0 comments on commit 0097e9f

Please sign in to comment.