mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 23:42:24 +00:00
feat(mdx-preview): add support for math rendering with KaTeX
This commit is contained in:
parent
0c2b3c897f
commit
2e33dea853
@ -1,8 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import "@/style/mdx.css";
|
||||
import "katex/dist/katex.min.css";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import remarkMath from "remark-math";
|
||||
import rehypeSlug from "rehype-slug";
|
||||
import rehypeKatex from "rehype-katex";
|
||||
import { useTheme } from "next-themes";
|
||||
import rehypePretty from "rehype-pretty-code";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
@ -55,8 +58,9 @@ export default function MdxPreview({ source }: MdxPreviewProps) {
|
||||
keepBackground: false,
|
||||
},
|
||||
],
|
||||
rehypeKatex,
|
||||
],
|
||||
remarkPlugins: [remarkGfm],
|
||||
remarkPlugins: [remarkGfm, remarkMath],
|
||||
},
|
||||
});
|
||||
setMdxSource(mdxSource);
|
||||
|
Loading…
Reference in New Issue
Block a user