fix: resolve Markdown v1 parsing failures in Telegram messages#2
Merged
rezhajulio merged 1 commit intomainfrom Feb 21, 2026
Merged
fix: resolve Markdown v1 parsing failures in Telegram messages#2rezhajulio merged 1 commit intomainfrom
rezhajulio merged 1 commit intomainfrom
Conversation
Two issues caused raw markdown to display instead of rendered links: 1. Parentheses in link text: Templates had '(mohon pertimbangkan...)' inside [...](...) link syntax, which breaks Telegram's Markdown v1 parser. Moved the parenthesized disclaimer outside the link. 2. Underscores in usernames: get_user_mention() returned raw @username without escaping. Usernames like @Sharo_Kenne have underscores that Markdown v1 interprets as italic markers, breaking parsing for the entire message. Added escape_markdown() for username mentions.
c71e6c7 to
e34bbdd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users reported raw unparsed markdown in group messages (e.g.
[Baca aturan grup](url)showing as plain text instead of clickable links).Root Cause
Two issues in Telegram's Markdown v1 parser:
Parentheses in link text: Templates like
[Hubungi... (mohon pertimbangkan...)]({dm_link})had parentheses inside the[...]portion, which confuses Telegram's parser.Underscores in usernames:
get_user_mention()returned raw@usernamewithout escaping. Usernames like@Sharo_Kennecontain_which Markdown v1 interprets as italic markers, poisoning the entire message's parsing.Fix
[Hubungi...]({dm_link}) (mohon...)escape_markdown()toget_user_mention()andget_user_mention_by_id()Testing
All 442 tests pass.