feat(html_utils): introduce wildcard in sanitize_html
Introduces a wildcard i.e. Disallows all HTML tags when used.
This commit is contained in:
parent
2ac1998000
commit
c3d8214124
1 changed files with 4 additions and 1 deletions
|
|
@ -170,6 +170,9 @@ def sanitize_html(html, linkify=False, always_sanitize=False, disallowed_tags=No
|
|||
|
||||
# Allow caller to explicitly disallow some tags
|
||||
if disallowed_tags:
|
||||
if disallowed_tags == "*":
|
||||
tags = set()
|
||||
else:
|
||||
tags.difference_update(disallowed_tags)
|
||||
|
||||
attributes = {"*": acceptable_attributes, "svg": svg_attributes}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue