Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 3eda82d

Browse files
committed
Update html.py
1 parent b660115 commit 3eda82d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyrogram/parser/html.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def __init__(self, client: Optional["pyrogram.Client"]):
117117
self.client = client
118118

119119
async def parse(self, text: str):
120-
# Strip whitespace characters from the end of the message, but preserve closing tags
120+
# Strip whitespaces from the beginning and the end, but preserve closing tags
121+
text = re.sub(r"^\s*(<[\w<>=\s\"]*>)\s*", r"\1", text)
121122
text = re.sub(r"\s*(</[\w</>]*>)\s*$", r"\1", text)
122123

123124
parser = Parser(self.client)

0 commit comments

Comments
 (0)