From ed943b1b5b3de79c0cda323df593e2f799401eac Mon Sep 17 00:00:00 2001 From: balibabu Date: Thu, 20 Feb 2025 12:19:53 +0800 Subject: [PATCH] Feat: Show formulas when answering, show reference labels in style, remove cursor flashing effect. #5173 (#5174) ### What problem does this PR solve? Feat: Show formulas when answering, show reference labels in style, remove cursor flashing effect. #5173 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/pages/chat/markdown-content/index.less | 4 ++++ web/src/pages/chat/markdown-content/index.tsx | 15 ++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/web/src/pages/chat/markdown-content/index.less b/web/src/pages/chat/markdown-content/index.less index 8454d6220..5d6c4765c 100644 --- a/web/src/pages/chat/markdown-content/index.less +++ b/web/src/pages/chat/markdown-content/index.less @@ -6,6 +6,10 @@ margin-bottom: 10px; font-size: 12px; } + :global(blockquote) { + padding-left: 10px; + border-left: 4px solid #ccc; + } } .referencePopoverWrapper { diff --git a/web/src/pages/chat/markdown-content/index.tsx b/web/src/pages/chat/markdown-content/index.tsx index d57190b09..d38ff0a52 100644 --- a/web/src/pages/chat/markdown-content/index.tsx +++ b/web/src/pages/chat/markdown-content/index.tsx @@ -27,7 +27,7 @@ import { pipe } from 'lodash/fp'; import styles from './index.less'; const reg = /(~{2}\d+={2})/g; -const curReg = /(~{2}\d+\${2})/g; +// const curReg = /(~{2}\d+\${2})/g; const getChunkIndex = (match: string) => Number(match.slice(2, -2)); // TODO: The display of the table is inconsistent with the display previously placed in the MessageItem. @@ -35,7 +35,6 @@ const MarkdownContent = ({ reference, clickDocumentButton, content, - loading, }: { content: string; loading: boolean; @@ -51,10 +50,8 @@ const MarkdownContent = ({ text = t('chat.searching'); } const nextText = replaceTextByOldReg(text); - return loading - ? nextText?.concat('~~2$$') // TODO: The style of thinking also needs to be displayed when outputting - : pipe(replaceThinkToSection, preprocessLaTeX)(nextText); - }, [content, loading, t]); + return pipe(replaceThinkToSection, preprocessLaTeX)(nextText); + }, [content, t]); useEffect(() => { const docAggs = reference?.doc_aggs; @@ -173,9 +170,9 @@ const MarkdownContent = ({ ); }); - replacedText = reactStringReplace(replacedText, curReg, (match, i) => ( - - )); + // replacedText = reactStringReplace(replacedText, curReg, (match, i) => ( + // + // )); return replacedText; },