Fixed HTML BlockQuote Issue

This commit is contained in:
Abir Arafat Chawdhury 2025-09-12 19:41:13 +06:00 committed by GitHub
parent 2b56fa91bb
commit 309f587eca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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