Allow Telegram blockquote expandable (#2427)

* Allow Telegram blockquote expandable

Blockquote is not yet supported, this feature adds support along with expandable functionality.

* Add support for tg-emoji in Telegram HTML

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
This commit is contained in:
Castle 2024-11-19 15:12:00 -03:00 committed by GitHub
parent ea66f6713b
commit 5c38de0dfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1454,8 +1454,11 @@ def strip_tag(data, agent_id=None):
's': [], 'strike': [], 'del': [],
'span': ['class'], 'tg-spoiler': [],
'a': ['href'],
'tg-emoji': ['emoji-id'],
'code': ['class'],
'pre': []}
'pre': [],
'blockquote': ['expandable'],
}
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
elif agent_id in (10, 14, 20, 25):