From 317685cf540c1a36bbb05990066907e4a23d48a6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 15 May 2021 18:35:57 +0200 Subject: [PATCH] Further improve the HTML parser Related to #682 --- pyrogram/parser/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/parser/html.py b/pyrogram/parser/html.py index f966a592..f3f55195 100644 --- a/pyrogram/parser/html.py +++ b/pyrogram/parser/html.py @@ -111,7 +111,7 @@ class HTML: async def parse(self, text: str): # Strip whitespace characters from the end of the message, but preserve closing tags - text = re.sub(r"\s*()\s*$", r"\1", text) + text = re.sub(r"\s*(]*>)\s*$", r"\1", text) parser = Parser(self.client) parser.feed(utils.add_surrogates(text))