mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +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
|
self.client = client
|
||||||
|
|
||||||
def parse(self, text: str):
|
def parse(self, text: str):
|
||||||
text = utils.add_surrogates(str(text or "").strip())
|
text = utils.add_surrogates(text)
|
||||||
|
|
||||||
parser = Parser(self.client)
|
parser = Parser(self.client)
|
||||||
parser.feed(text)
|
parser.feed(text)
|
||||||
|
@ -31,6 +31,8 @@ class Parser:
|
|||||||
self.markdown = Markdown(client)
|
self.markdown = Markdown(client)
|
||||||
|
|
||||||
def parse(self, text: str, mode: str = ""):
|
def parse(self, text: str, mode: str = ""):
|
||||||
|
text = str(text or "").strip()
|
||||||
|
|
||||||
if mode is None:
|
if mode is None:
|
||||||
return OrderedDict([
|
return OrderedDict([
|
||||||
("message", text),
|
("message", text),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user