Problem
When sending messages via h2 send telegram, dollar signs ($) in message text are stripped/eaten. For example, $200 disappears entirely from the rendered message.
This appears to be caused by Telegram interpreting $ as a LaTeX/math delimiter when using MarkdownV2 parse mode.
Expected behavior
Dollar signs in message text should be preserved and displayed correctly, regardless of which parse mode is used.
Workaround
Using --format HTML avoids the issue since HTML parse mode doesn't treat $ as special. Writing out "dollar" instead of using the symbol also works.
Suggested fix
Options:
- Escape
$ characters when using MarkdownV2 parse mode (prepend with \)
- Default to HTML parse mode for the Telegram bridge
- Auto-detect and escape special characters based on the active parse mode
Reproduction
h2 send telegram "This costs $200 per month"
[ubuntu] This costs 00 per month
The message arrives as: "This costs 200 per month" (dollar sign missing).
Environment
Problem
When sending messages via
h2 send telegram, dollar signs ($) in message text are stripped/eaten. For example,$200disappears entirely from the rendered message.This appears to be caused by Telegram interpreting
$as a LaTeX/math delimiter when using MarkdownV2 parse mode.Expected behavior
Dollar signs in message text should be preserved and displayed correctly, regardless of which parse mode is used.
Workaround
Using
--format HTMLavoids the issue since HTML parse mode doesn't treat$as special. Writing out "dollar" instead of using the symbol also works.Suggested fix
Options:
$characters when using MarkdownV2 parse mode (prepend with\)Reproduction
The message arrives as: "This costs 200 per month" (dollar sign missing).
Environment