2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Do string conversion and striping in the Parser

This commit is contained in:
Dan 2019-06-30 21:08:50 +02:00
parent 40b0c57b54
commit a790431274
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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),