Don't strip tags from webhook agent

This commit is contained in:
JonnyWong16 2020-03-14 15:31:18 -07:00
parent 1f83afc2f4
commit 50398049f5

View file

@ -1209,10 +1209,6 @@ def strip_tag(data, agent_id=None):
'font': ['color']}
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
elif agent_id in (10, 14, 20):
# Don't remove tags for Email, Slack, and Discord
pass
elif agent_id == 13:
# Allow tags b, i, code, pre, a[href] for Telegram
whitelist = {'b': [],
@ -1222,6 +1218,10 @@ def strip_tag(data, agent_id=None):
'a': ['href']}
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
elif agent_id in (10, 14, 20, 25):
# Don't remove tags for Email, Slack, Discord, and Webhook
pass
else:
whitelist = {}
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)