diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index d4010df8..06b3e103 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -36,6 +36,7 @@ class Str(str): def __init__(self, value): str.__init__(value) self._markdown = None + self._html = None @property def markdown(self): @@ -45,6 +46,14 @@ class Str(str): def markdown(self, value): self._markdown = value + @property + def html(self): + return self._html + + @html.setter + def html(self, value): + self._html = value + ENTITIES = { types.MessageEntityMention.ID: "mention", @@ -572,10 +581,16 @@ def parse_messages( ) if m.text: - m.text.markdown = client.markdown.unparse(m.text, m.entities or []) + args = (m.text, m.entities or []) + + m.text.markdown = client.markdown.unparse(*args) + m.text.html = client.html.unparse(*args) if m.caption: - m.caption.markdown = client.markdown.unparse(m.caption, m.caption_entities or []) + args = (m.caption, m.caption_entities or []) + + m.caption.markdown = client.markdown.unparse(*args) + m.caption.html = client.html.unparse(*args) if message.reply_to_msg_id and replies: while True: