import React from "react"; import Markdown from "react-markdown"; import remarkGfm from "remark-gfm"; import remarkBreaks from "remark-breaks"; import remarkMath from "remark-math"; import rehypeRaw from "rehype-raw"; import rehypeKatex from "rehype-katex"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { gruvboxDark } from "react-syntax-highlighter/dist/esm/styles/prism"; import "katex/dist/katex.min.css"; type MarkdownRendererProps = { children: string; }; export default function MarkdownRenderer({ children: markdown, }: MarkdownRendererProps) { return ( {String(children).replace(/\n$/, "")} ) : ( {children} ); }, ul({ children, ...props }) { return ( ); }, ol({ children, ...props }) { return (
    {children}
); }, li({ children, ...props }) { return (
  • {children}
  • ); }, }} > {markdown}
    ); }