Fix Telegram dedup identity and legacy Markdown escaping

This commit is contained in:
calesthio
2026-03-24 18:48:55 -07:00
parent b7322f1c7e
commit 5c08355e38
3 changed files with 40 additions and 8 deletions

View File

@@ -744,7 +744,9 @@ Respond with ONLY valid JSON:
function escapeMd(text) {
if (!text) return '';
return text.replace(/([_*\[\]()~`>#+\-=|{}.!\\])/g, '\\$1');
// The bot sends alerts with legacy Markdown parse mode, not MarkdownV2.
// Escape only the characters that legacy Markdown actually treats as markup.
return text.replace(/([_*`\[])/g, '\\$1');
}
function parseJSON(text) {