Skip to content

telegram: rich messages render $…$ as math and collapse single newlines #1109

Open

Description

@chiptoe-svg

Since 4.41, postMessage({ markdown }) goes through sendRichMessage with the markdown passed unchanged (resolveRichMessage). Telegram's rich-message parser differs from the CommonMark the adapter assumes elsewhere:

  • $…$ is inline math. MU ~$950 (-3.3% from $983.23). TSLA ~$403 renders 950(−3.3from983.23)… as a formula, and % inside it starts a TeX comment that drops the rest of the span.
  • A single \n is a soft break, so line-per-item text (• a\n• b) becomes one paragraph. The MarkdownV2 path kept those lines.

\$ and trailing-backslash hard breaks both render correctly in sendRichMessage. Verified with the Bot API directly. Still present in 4.43.0.

Suggested fix: escape $ outside code, and either emit hard breaks for soft line breaks or document that callers must.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions