mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-28 23:35:59 +00:00
Telegram API rejects messages with mismatched HTML tags. When truncate_for_blockquote cuts the description mid-way, it can leave tags like <i>, <b> unclosed inside the blockquote. Telegram then fails with "Unmatched end tag" error. Add _close_open_tags helper that scans for unclosed tags and appends closing tags in reverse order. Also ensure the total length with closing tags still fits within the message budget.