import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import remarkMath from 'remark-math' import rehypeKatex from 'rehype-katex' import 'katex/dist/katex.min.css' import type { ComponentPropsWithoutRef } from 'react' interface MarkdownRendererProps { content: string className?: string } export function MarkdownRenderer({ content, className = '' }: MarkdownRendererProps) { return (
{children}
) : (
{children}
)
},
// 自定义表格样式
table({ children, ...props }) {
return (
{children}) }, // 自定义标题样式 h1({ children, ...props }) { return (
{children}
) }, // 自定义分隔线样式 hr({ ...props }) { return