From 27f9d62cf9eb2f796cc302b331b293bc2404a818 Mon Sep 17 00:00:00 2001 From: davte Date: Mon, 26 Dec 2022 12:13:53 +0100 Subject: [PATCH] Make the regex dot match any character at all, including a newline, when cleaning HTML strings (so multiline tag bodies are allowed, as they are in Telegram HTML markdown). --- davtelepot/__init__.py | 2 +- davtelepot/utilities.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index d5a7750..9dfe3c3 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -11,7 +11,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.8.10" +__version__ = "2.8.11" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/utilities.py b/davtelepot/utilities.py index e542278..9d5e3c8 100644 --- a/davtelepot/utilities.py +++ b/davtelepot/utilities.py @@ -1450,7 +1450,8 @@ def clean_html_string(text: str) -> str: rf'(?P<{tag}{attribute}>)' rf'(?P.*?)' rf'(?P)', - text + text, + flags=re.DOTALL ) if match and (first_match is None or match.start() < first_match.start()): first_match = match