From a84e5ebc6a88b78a368700d4bd77c5df9e04b322 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 29 Oct 2023 12:06:39 +0200 Subject: [PATCH] Remove redundant
's after block tags when converting from Telegram --- mautrix_telegram/formatter/from_telegram.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/formatter/from_telegram.py b/mautrix_telegram/formatter/from_telegram.py index d012117d..acff7eed 100644 --- a/mautrix_telegram/formatter/from_telegram.py +++ b/mautrix_telegram/formatter/from_telegram.py @@ -348,7 +348,11 @@ def text_to_html( last_offset = relative_offset + (0 if skip_entity else entity.length) html.append(text_to_html(text[last_offset:])) - return "".join(html) + html_string = "".join(html) + # Remove redundant
's after block tags + html_string = html_string.replace("
", "") + html_string = html_string.replace("
", "") + return html_string def _parse_pre(html: list[str], entity_text: str, language: str) -> bool: