import ReactMarkdown from 'react-markdown'; import rehypeRaw from 'rehype-raw'; import { replaceStr, mergeReplaceToDiv } from '../../utils/tools'; import { Popover } from 'antd'; import classNames from 'classnames'; import styles from './index.module.less'; import { useEffect } from 'react'; interface IMarkdownProps { source: string; refList?: any; quoType?: string; chatIsOver?: boolean; } const CustomMarkdown = ({ source, refList = null, quoType = 'single', chatIsOver = false }: IMarkdownProps) => { const linkToExtend = (url: string) => { window.open(url); }; const CustomI = ({ children, className, ...props }: any) => { const content = refList ? Object.keys(refList).map((item) => { if (Number(item) === Number(children)) { return (
{children}
);
};
const CustomDiv = ({ children, className, ...props }: any) => {
const list = props['data-ids'].split(',');
const content = refList
? Object.keys(refList).map((item) => {
if (list.includes(String(item))) {
return (
<>
{children}
);
};
return (