From: Anderson A. Giacomolli Date: Sat, 7 Nov 2026 14:37:49 +0000 (-0300) Subject: Convert reply Markdown to Telegram entities X-Git-Url: http://git.giacomolli.uk/onechat/commitdiff_plain/fc51ee2f545233df3cc1fa2fd4f28a4484c6bc00?ds=inline;hp=fc51ee2f545233df3cc1fa2fd4f28a4484c6bc00 Convert reply Markdown to Telegram entities A converter on the standard library turns the Markdown of a model reply into plain text and Telegram message entities. It knows bold, italic, strikethrough, inline code, fenced code blocks with an optional language, links, and ATX headings, which become bold. Lists, quotes and tables stay as their text. With entities, the text needs no escaping, so a mark that does not close only stays as text, and it cannot make Telegram refuse the message. Inline marks do not cross a line break, so one open mark cannot change the rest of a reply. Underscores inside a word stay as text, so snake_case names do not turn italic, and an asterisk that a space follows, as in a list item, opens nothing. Code holds no entity. The offsets and lengths count UTF-16 code units, as Telegram does. Issue: 3309f9b ---