fix: safari reg error

This commit is contained in:
archer
2023-05-16 14:25:51 +08:00
parent 371e0e36c6
commit 021add2af4
4 changed files with 14 additions and 4 deletions

View File

@@ -13,12 +13,20 @@ import 'katex/dist/katex.min.css';
import styles from './index.module.scss';
import { codeLight } from './codeLight';
const Markdown = ({ source, isChatting = false }: { source: string; isChatting?: boolean }) => {
const Markdown = ({
source,
isChatting = false,
formatLink
}: {
source: string;
formatLink?: boolean;
isChatting?: boolean;
}) => {
const { copyData } = useCopyData();
const formatSource = useMemo(() => {
return formatLinkTextToHtml(source);
}, [source]);
return formatLink ? formatLinkTextToHtml(source) : source;
}, [source, formatLink]);
return (
<ReactMarkdown