Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

escape backslash

Blue Mousee76ae8ceab0c
diff --git a/backend/apps/cloud/src/integrations/telegram/telegram.service.ts b/backend/apps/cloud/src/integrations/telegram/telegram.service.ts
index 52caac867..87cce7beb 100644
--- a/backend/apps/cloud/src/integrations/telegram/telegram.service.ts
+++ b/backend/apps/cloud/src/integrations/telegram/telegram.service.ts
@@ -107,8 +107,8 @@ export class TelegramService {
escapeTelegramMarkdownV2(text?: string | null) {
if (text === null || text === undefined) return ''
- // Characters to escape for MarkdownV2: _ * [ ] ( ) ~ ` > # + - = | { } . !
- const charsToEscapeRegex = /[_*[\]()~`>#+\-=|{}.!]/g
+ // Characters to escape for MarkdownV2: _ * [ ] ( ) ~ ` > # + - = | { } . ! and \ (not requested by Telegram, but CodeQL is complaining)
+ const charsToEscapeRegex = /[_*[\]()~`>#+\-=|{}.!\\]/g
return text.replace(charsToEscapeRegex, '\\$&')
}