From 021add2af44f4221abd8c10ca356c1934cf09fb2 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Tue, 16 May 2023 14:25:51 +0800 Subject: [PATCH] fix: safari reg error --- src/components/Markdown/index.tsx | 14 +++++++++++--- src/pages/chat/index.tsx | 1 + src/pages/chat/share.tsx | 1 + src/utils/tools.ts | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/Markdown/index.tsx b/src/components/Markdown/index.tsx index e86d51933..1db278935 100644 --- a/src/components/Markdown/index.tsx +++ b/src/components/Markdown/index.tsx @@ -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 ( {item.systemPrompt && (