feat: support code highlight and markdown gfm

This commit is contained in:
Yifei Zhang
2023-03-20 06:06:29 +00:00
parent 12f52bf252
commit f5aef317df
8 changed files with 448 additions and 24 deletions

View File

@@ -0,0 +1,14 @@
import ReactMarkdown from "react-markdown";
import "katex/dist/katex.min.css";
import RemarkMath from "remark-math";
import RehypeKatex from "rehype-katex";
import RemarkGfm from 'remark-gfm'
import RehypePrsim from 'rehype-prism-plus'
export function Markdown(props: { content: string }) {
return (
<ReactMarkdown remarkPlugins={[RemarkMath, RemarkGfm]} rehypePlugins={[RehypeKatex, RehypePrsim]}>
{props.content}
</ReactMarkdown>
);
}