diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 9a662e2c..b8a4b902 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -1375,12 +1375,16 @@ def strip_tag(data, agent_id=None): data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True) elif agent_id == 13: - # Allow tags b, i, code, pre, a[href] for Telegram - whitelist = {'b': [], - 'i': [], - 'code': [], - 'pre': [], - 'a': ['href']} + # Allow tags for Telegram + # https://core.telegram.org/bots/api#html-style + whitelist = {'b': [], 'strong': [], + 'i': [], 'em': [], + 'u': [], 'ins': [], + 's': [], 'strike': [], 'del': [], + 'span': ['class'], 'tg-spoiler': [], + 'a': ['href'], + 'code': ['class'], + 'pre': []} data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True) elif agent_id in (10, 14, 20, 25): diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 1c8bf0fb..42df413d 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -3963,7 +3963,9 @@ class TELEGRAM(Notifier): {'label': 'Enable HTML Support', 'value': self.config['html_support'], 'name': 'telegram_html_support', - 'description': 'Style your messages using these HTML tags: b, i, a[href], code, pre.', + 'description': 'Enable to style your messages using these HTML tags:
' + 'b, strong, i, em, u, ins, s, strike, del, span[class], ' + 'tg-spoiler, a[href], code[class], pre', 'input_type': 'checkbox' }, {'label': 'Disable Web Page Previews',