Skip to content

fix(telegram): render markdown messages safely#3712

Merged
Hmbown merged 2 commits into
Hmbown:mainfrom
cyq1017:codex/codewhale-2967-mdv2-formatting
Jun 28, 2026
Merged

fix(telegram): render markdown messages safely#3712
Hmbown merged 2 commits into
Hmbown:mainfrom
cyq1017:codex/codewhale-2967-mdv2-formatting

Conversation

@cyq1017

@cyq1017 cyq1017 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Refs #2967

Problem

Telegram bridge replies currently send raw Markdown-looking text, so code, links, and simple tables render poorly on phones. Enabling MarkdownV2 directly is risky because Telegram parse errors can drop the message.

Change

  • Render Telegram messages as MarkdownV2 with escaping for text, links, inline code, fenced code, and simple pipe tables.
  • Fall back to stripped plain text when MarkdownV2 would exceed the chunk limit or Telegram returns a parse error.
  • Keep existing chunking, retry, and reply markup behavior.

Verification

  • npm test
  • npm run check
  • git diff --check upstream/main...HEAD

@cyq1017 cyq1017 marked this pull request as ready for review June 28, 2026 06:16
@cyq1017 cyq1017 requested a review from Hmbown as a code owner June 28, 2026 06:16
@Hmbown Hmbown merged commit 9e912de into Hmbown:main Jun 28, 2026
14 checks 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