Skip to content

skarrok/validate-telegram-markdown

Repository files navigation

Validate Telegram Markdown

Lint and Test pypi package python

This package tries to validate that telegram-flavored markdown is correct and safe to use in sendMessage.

Simple and naive implementation, probably has bugs but good enough for my personal use case.

Supports all features of MarkdownV2 Style.

Contributions are welcome!

Installation

pip install validate-telegram-markdown

Usage

from validate_telegram_markdown import validate_markdown

message = "*bold*"
try:
    validate_markdown(message)
except ValueError:
    # something isn't right
    raise

# or here you can safely use message in telegram sendMessage method