From 316f3115f6c5bde4d2a37f9b8fbaadffb518e084 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 May 2026 16:28:35 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20markdownToHtml=20multiline=20bold=20?= =?UTF-8?q?=E2=80=94=20[\s\S]=20instead=20of=20dot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GLM outputs multi-line **bold** blocks in essays. The dot regex .+? does not match newlines, so multiline bold rendered as raw **. --- src/bot/message-sender.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot/message-sender.js b/src/bot/message-sender.js index 6ba42b68..53cbccd6 100644 --- a/src/bot/message-sender.js +++ b/src/bot/message-sender.js @@ -63,7 +63,7 @@ export function markdownToHtml(text) { // 4. Convert Markdown patterns → HTML tags text = text - .replace(/\*\*(.+?)\*\*/g, '$1') // **bold** + .replace(/\*\*([\s\S]+?)\*\*/g, '$1') // **bold** (multiline) .replace(/(?$1') // *italic* (not inside **) .replace(/~~(.+?)~~/g, '$1') // ~~strike~~ .replace(/\[(.+?)\]\((.+?)\)/g, '$1') // [link](url)