mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 21:22:40 +00:00
Allow Markdown and HTML styles to work on an empty dict.
For inline results. User mentions are disabled this way
This commit is contained in:
parent
e59d07af1e
commit
c5cedd880d
@ -34,8 +34,8 @@ class HTML:
|
||||
HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])([^<]+)\2)?>([^>]+)</\1>")
|
||||
MENTION_RE = re.compile(r"tg://user\?id=(\d+)")
|
||||
|
||||
def __init__(self, peers_by_id):
|
||||
self.peers_by_id = peers_by_id
|
||||
def __init__(self, peers_by_id: dict = None):
|
||||
self.peers_by_id = peers_by_id or {}
|
||||
|
||||
def parse(self, text):
|
||||
entities = []
|
||||
|
@ -51,8 +51,8 @@ class Markdown:
|
||||
))
|
||||
MENTION_RE = re.compile(r"tg://user\?id=(\d+)")
|
||||
|
||||
def __init__(self, peers_by_id: dict):
|
||||
self.peers_by_id = peers_by_id
|
||||
def __init__(self, peers_by_id: dict = None):
|
||||
self.peers_by_id = peers_by_id or {}
|
||||
|
||||
def parse(self, message: str):
|
||||
message = utils.add_surrogates(message).strip()
|
||||
|
Loading…
Reference in New Issue
Block a user