From d20bdc959f83b3ec80ded11ec2219c401c7c7a41 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Mon, 2 Mar 2026 11:15:38 +0800 Subject: [PATCH] v0.1.2 --- frontend/src/modules/dashboard/BotDashboardModule.css | 10 +++++++++- frontend/src/modules/dashboard/messageParser.ts | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/modules/dashboard/BotDashboardModule.css b/frontend/src/modules/dashboard/BotDashboardModule.css index 945fd79..5d165e1 100644 --- a/frontend/src/modules/dashboard/BotDashboardModule.css +++ b/frontend/src/modules/dashboard/BotDashboardModule.css @@ -390,7 +390,7 @@ } .ops-chat-text { - white-space: pre-wrap; + white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.58; @@ -398,6 +398,10 @@ color: var(--text); } +.ops-chat-text .whitespace-pre-wrap { + white-space: pre-wrap; +} + .ops-chat-text.is-collapsed { max-height: 220px; overflow: hidden; @@ -429,6 +433,10 @@ margin: 8px 0; } +.ops-chat-text p:empty { + margin: 0; +} + .ops-chat-text pre { margin: 8px 0; overflow: auto; diff --git a/frontend/src/modules/dashboard/messageParser.ts b/frontend/src/modules/dashboard/messageParser.ts index cee7faa..9f4afc6 100644 --- a/frontend/src/modules/dashboard/messageParser.ts +++ b/frontend/src/modules/dashboard/messageParser.ts @@ -51,6 +51,10 @@ export function normalizeAssistantMessageText(input: string) { // Remove dashboard wrapper if channel accidentally outputs raw marker line. text = text.replace(/__DASHBOARD_DATA_START__/g, '').replace(/__DASHBOARD_DATA_END__/g, '').trim(); + // Keep HTML-enabled markdown readable: cap excessive HTML line breaks/empty paragraphs. + text = text.replace(/(?:\s*){4,}/gi, '

'); + text = text.replace(/(?:

(?:\s| |)*<\/p>\s*){3,}/gi, '


'); + // Reduce excessive blank lines while keeping markdown readability. text = text.replace(/\n{4,}/g, '\n\n\n'); return text;