diff --git a/pyrogram/client/style/markdown.py b/pyrogram/client/style/markdown.py index c37dd526..2092a13e 100644 --- a/pyrogram/client/style/markdown.py +++ b/pyrogram/client/style/markdown.py @@ -105,6 +105,7 @@ class Markdown: ) def unparse(self, message: str, entities: list): + message = utils.add_surrogates(message).strip() offset = 0 for entity in entities: @@ -139,4 +140,4 @@ class Markdown: message = message[:start] + message[start:].replace( sub, "{0}{1}{0}".format(style, sub), 1) - return message + return utils.remove_surrogates(message)