diff --git a/pyrogram/client/parser/html.py b/pyrogram/client/parser/html.py
index 16c5922a..04f4ad30 100644
--- a/pyrogram/client/parser/html.py
+++ b/pyrogram/client/parser/html.py
@@ -108,7 +108,7 @@ class HTML:
self.client = client
def parse(self, text: str):
- text = utils.add_surrogates(str(text or "").strip())
+ text = utils.add_surrogates(text)
parser = Parser(self.client)
parser.feed(text)
diff --git a/pyrogram/client/parser/parser.py b/pyrogram/client/parser/parser.py
index f685c942..cde26f0b 100644
--- a/pyrogram/client/parser/parser.py
+++ b/pyrogram/client/parser/parser.py
@@ -31,6 +31,8 @@ class Parser:
self.markdown = Markdown(client)
def parse(self, text: str, mode: str = ""):
+ text = str(text or "").strip()
+
if mode is None:
return OrderedDict([
("message", text),