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:
parent
40b0c57b54
commit
a790431274
@ -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)
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user