markdown.tsx 527 B

1234567891011121314151617181920
  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
  10. remarkPlugins={[RemarkMath, RemarkGfm]}
  11. rehypePlugins={[
  12. RehypeKatex,
  13. [RehypePrsim, { ignoreMissing: true }],
  14. ]}
  15. >
  16. {props.content}
  17. </ReactMarkdown>
  18. );
  19. }