Skip to content

Conversation

@julwrites
Copy link
Owner

No description provided.

google-labs-jules bot and others added 2 commits November 28, 2025 07:55
This change refactors `escapeMarkdownV2` to use a manual switch statement, ensuring that all reserved characters (including backslashes and dots) are explicitly and correctly escaped. This resolves issues where unescaped special characters, particularly in edge cases involving existing backslashes, caused `400 Bad Request` errors from the Telegram API.

- Replaced `strings.NewReplacer` with a rune-based loop.
- Added explicit test case for trailing dots and backslashes to prevent regression.
Correctly escape Telegram MarkdownV2 special characters
@julwrites julwrites merged commit 23be324 into master Nov 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants