mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-09-19 02:12:40 +03:00
Merge 309f587eca
into 859a83a1a5
This commit is contained in:
commit
9be62555ef
|
@ -33,16 +33,20 @@ class HTMLToTelegramParser(HTMLParser):
|
||||||
attrs = dict(attrs)
|
attrs = dict(attrs)
|
||||||
EntityType = None
|
EntityType = None
|
||||||
args = {}
|
args = {}
|
||||||
if tag == 'strong' or tag == 'b':
|
if tag in ["strong", "b"]:
|
||||||
EntityType = MessageEntityBold
|
EntityType = MessageEntityBold
|
||||||
elif tag == 'em' or tag == 'i':
|
elif tag in ["em", "i"]:
|
||||||
EntityType = MessageEntityItalic
|
EntityType = MessageEntityItalic
|
||||||
elif tag == 'u':
|
elif tag == 'u':
|
||||||
EntityType = MessageEntityUnderline
|
EntityType = MessageEntityUnderline
|
||||||
elif tag == 'del' or tag == 's':
|
elif tag in ["del", "s"]:
|
||||||
EntityType = MessageEntityStrike
|
EntityType = MessageEntityStrike
|
||||||
elif tag == 'blockquote':
|
elif tag == 'blockquote':
|
||||||
EntityType = MessageEntityBlockquote
|
EntityType = MessageEntityBlockquote
|
||||||
|
if 'expandable' in attrs:
|
||||||
|
args["collapsed"] = True
|
||||||
|
else:
|
||||||
|
args["collapsed"] = False
|
||||||
elif tag == 'code':
|
elif tag == 'code':
|
||||||
try:
|
try:
|
||||||
# If we're in the middle of a <pre> tag, this <code> tag is
|
# If we're in the middle of a <pre> tag, this <code> tag is
|
||||||
|
|
Loading…
Reference in New Issue
Block a user