fix: LaTeX cannot render properly (#387)

This commit is contained in:
Xuezhou Dai
2023-04-19 21:35:48 +01:00
committed by GitHub
parent 4502d0ffaa
commit 77a3f805e1
2 changed files with 14 additions and 6 deletions
+9 -1
View File
@@ -178,7 +178,15 @@
}
.prose .math {
@apply max-w-full inline-block overflow-x-scroll;
@apply max-w-full;
}
.prose .katex {
@apply overflow-x-auto;
}
.prose .katex-html {
@apply py-2;
}
.xlog-comment .prose {
+5 -5
View File
@@ -108,7 +108,6 @@ export const renderPageContent = (
.use(remarkMermaid)
.use(remarkMath)
.use(remarkRehype, { allowDangerousHtml: true })
.use(rehypeKatex) // There may be $ symbol parsing errors
.use(rehypeStringify)
.use(rehypeRaw)
.use(rehypeImage, { env })
@@ -142,10 +141,6 @@ export const renderPageContent = (
},
})
.use(rehypeSanitize, sanitizeScheme)
.use(rehypePrism, {
ignoreMissing: true,
showLineNumbers: true,
})
.use(rehypeTable)
.use(rehypeExternalLink)
.use(rehypeWrapCode)
@@ -183,6 +178,11 @@ export const renderPageContent = (
}
},
})
.use(rehypePrism, {
ignoreMissing: true,
showLineNumbers: true,
})
.use(rehypeKatex) // There may be $ symbol parsing errors
.use(html ? () => (tree: any) => {} : rehypeReact, {
createElement: createElement,
components: {