From 3eda82d0aff94c24d2ba1ecd5767de5ae70c09e2 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 16 Oct 2022 12:07:24 +0200 Subject: [PATCH] Update html.py --- pyrogram/parser/html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrogram/parser/html.py b/pyrogram/parser/html.py index af70c5cb..7ed2a5be 100644 --- a/pyrogram/parser/html.py +++ b/pyrogram/parser/html.py @@ -117,7 +117,8 @@ class HTML: self.client = client async def parse(self, text: str): - # Strip whitespace characters from the end of the message, but preserve closing tags + # Strip whitespaces from the beginning and the end, but preserve closing tags + text = re.sub(r"^\s*(<[\w<>=\s\"]*>)\s*", r"\1", text) text = re.sub(r"\s*(]*>)\s*$", r"\1", text) parser = Parser(self.client)