Telegram bot converting Telegram's rich text to Markdown.
Relevant technical details can be found on the blog post Rich-Text in Telegram: A Guide to Converting to Markdown and Understanding the Logic Behind Markup Languages.
The code is intended to run on Deno Deploy
Send formatted meassage to the Telegram bot and the bot will send the message back in Markdown.
By default, "spoiler" and "underline" are ignored, because these styles are generally not available in Markdown (dialects).
To force convert "spoiler" and "underline" entities, add !unstable
at the beginning of your rich text, and the bot will use HTML tags for convertion. But this feature can bring compatibility issues in edge cases.
Find bugs in edge cases? No problem. Pull requests are welcomed!