From: Anderson A. Giacomolli Date: Sat, 7 Nov 2026 17:59:33 +0000 (-0300) Subject: Escape tags in the Markdown of rich replies X-Git-Url: https://git.giacomolli.uk/onechat/commitdiff_plain/de170709599e849c6b409d247b800dc68b0c7ab7?ds=sidebyside;hp=de170709599e849c6b409d247b800dc68b0c7ab7 Escape tags in the Markdown of rich replies The bot puts a backslash before each < of a reply outside inline code and fenced code blocks before it sends the reply with sendRichMessage. Rich Markdown reads a tag in prose, such as
, as raw HTML: the tag name is lost and the rest of the paragraph is in a collapsed section. With the escape, Telegram shows the tag as written, and a reply cannot carry raw HTML. Inline code and code blocks keep their text, also a code block that a split opens again, because the escape runs before the split. The split thus counts the escaped text against the length limit. A < that a backslash already makes plain stays as it is. The pipe, the dollar sign, and the equals sign are not escaped: the tables use the pipe, and the live check showed no problem with the dollar sign. The entity fallback reads the backslash as an escape, so it shows the same text as before. Other events go as plain text and do not change. Issue: d75e312 ---