From 30c09d06134837cf311068d746ac4c476b322db5 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 16 Nov 2025 21:58:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B6=88=E6=81=AF,=20=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=96=87=E5=AD=97(trim)=E4=B8=BA=E7=A9=BA=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/chat/Message.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/ui/chat/Message.tsx b/client/ui/chat/Message.tsx index 939a9bc..8a327dc 100644 --- a/client/ui/chat/Message.tsx +++ b/client/ui/chat/Message.tsx @@ -29,9 +29,11 @@ function prettyFlatParsedMessage(html: string) { let lastElementType = '' function checkContinuousElement(tagName: string) { if (lastElementType != tagName) { - if (lastElementType == 'chat-text') - ret += `${ls.map((v) => v.outerHTML).join('')}` - else + console.log(lastElementType, ls.map((v) => v.innerHTML)) + if (textElementTags.indexOf(lastElementType) != -1) { + if (ls.map((v) => v.innerHTML).join('').trim() != '') + ret += `${ls.map((v) => v.outerHTML).join('')}` + } else ret += ls.map((v) => v.outerHTML).join('') ls = [] }