mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 00:47:28 +08:00
feat: support code highlight and markdown gfm
This commit is contained in:
14
app/components/markdown.tsx
Normal file
14
app/components/markdown.tsx
Normal 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>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user