markdown.tsx 473 B

1234567891011121314
  1. import ReactMarkdown from "react-markdown";
  2. import "katex/dist/katex.min.css";
  3. import RemarkMath from "remark-math";
  4. import RehypeKatex from "rehype-katex";
  5. import RemarkGfm from 'remark-gfm'
  6. import RehypePrsim from 'rehype-prism-plus'
  7. export function Markdown(props: { content: string }) {
  8. return (
  9. <ReactMarkdown remarkPlugins={[RemarkMath, RemarkGfm]} rehypePlugins={[RehypeKatex, RehypePrsim]}>
  10. {props.content}
  11. </ReactMarkdown>
  12. );
  13. }