From 31ece25252658c0c35a2f7ae64601f51f238bd01 Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Thu, 29 May 2025 11:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(Playground):=20Prevent=20mar?= =?UTF-8?q?kdown=20error=20from=20=20tags=20in=20reasoning=20displa?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Modified the `renderCustomChatContent` function to strip `` and `` tags from `finalExtractedThinkingContent` before passing it to the `MarkdownRender` component. This resolves potential parsing errors caused by unclosed or malformed tags. - Added a conditional check to ensure that the thinking process block is only rendered if `finalExtractedThinkingContent` has actual content and the section is expanded, improving rendering stability. --- web/src/pages/Playground/Playground.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Playground/Playground.js b/web/src/pages/Playground/Playground.js index ec10931c..8ec9dacd 100644 --- a/web/src/pages/Playground/Playground.js +++ b/web/src/pages/Playground/Playground.js @@ -1161,11 +1161,11 @@ const Playground = () => { className={`transition-all duration-500 ease-out ${message.isReasoningExpanded ? 'max-h-96 opacity-100' : 'max-h-0 opacity-0' } overflow-hidden`} > - {message.isReasoningExpanded && ( + {message.isReasoningExpanded && finalExtractedThinkingContent && (
- + /g, '')} />