telegram-escape 0.3.0

Escape text for Telegram's MarkdownV2 format
Documentation
1
2
3
4
5
6
7
8
def tg_escape(text: str) -> str:
    """Escape text for Telegram's MarkdownV2 formatting.

    Applies context-aware escaping:
    - In regular text: escapes ``_*[]()~`>#+-=|{}.!\\`` characters
    - In code blocks and inline code: only escapes `` ` `` and ``\\`` characters
    """
    ...