From 4f2d382fd69041a21ea06ef9b48ccf5849a7102d Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 13 Jan 2026 12:57:54 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20Markdown=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=E7=9A=84=E5=B7=A5=E5=85=B7=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 1 + resources/assets/js/functions/web.js | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index b28c13fa6..cc43b746d 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -713,6 +713,7 @@ class WebSocketDialogMsg extends AbstractModel $text = $msgData['text'] ?? ''; if (!$text) return ''; if ($msgData['type'] === 'md') { + $text = preg_replace('/<\/?tool-use[^>]*>/', '', $text); $text = preg_replace("/:::\s*reasoning[\s\S]*?:::/", "", $text); if (preg_match('/:::\s*reasoning\s+/', $text)) { return Doo::translate('思考中...'); diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 5bbf2ab62..c63b3208b 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -269,6 +269,7 @@ import {convertLocalResourcePath} from "../components/Replace/utils"; return ''; } if (type === 'md') { + text = text.replace(/<\/?tool-use[^>]*>/g, ''); text = text.replace(/:::\s*reasoning[\s\S]*?:::/g, ""); if (/:::\s*reasoning\s+/.test(text)) { return $A.L('思考中...')