Core functionality of telegramify-markdown
mainThe telegramify-markdown library is designed to convert raw Markdown into Telegram-compatible output while preventing the common escaping failures associated with Telegram's MarkdownV2 format.
Key capabilities include:
- Markdown to Entities: Converts Markdown into a combination of plain text and a list of Telegram
MessageEntityobjects. - Long Message Handling: An async pipeline that splits long outputs and extracts code blocks or Mermaid diagrams.
- Fallback Conversion: Converts entity-based output back into
MarkdownV2if the target middleware does not support sending entities. - Rich Message Support: Provides optional output for Telegram Bot API 10.1 structured Rich Messages.