From 7c9f1cb8ef27ed55dd3b1a4fdf874833e7b832c7 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 15 May 2021 18:14:27 +0200 Subject: [PATCH] Improve the HTML parser Fixes #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 e73cb3aa..f966a592 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))