import classNames from 'classnames'; import Markdown from 'react-markdown'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import rehypeKatex from 'rehype-katex'; import rehypeRaw from 'rehype-raw'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for you import { preprocessLaTeX } from '@/utils/chat'; import styles from './index.less'; const HightLightMarkdown = ({ children, }: { children: string | null | undefined; }) => { return ( {String(children).replace(/\n$/, '')} ) : ( {children} ); }, } as any } > {children ? preprocessLaTeX(children) : children} ); }; export default HightLightMarkdown;