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