fix(sanitize-html): allow all data-* attrs
This commit is contained in:
parent
2101a2d576
commit
cafd2c920d
1 changed files with 7 additions and 1 deletions
|
|
@ -162,7 +162,13 @@ def sanitize_html(html, linkify=False):
|
|||
+ mathml_elements
|
||||
+ ["html", "head", "meta", "link", "body", "style", "o:p"]
|
||||
)
|
||||
attributes = {"*": acceptable_attributes, "svg": svg_attributes}
|
||||
|
||||
def attributes_filter(tag, name, value):
|
||||
if name.startswith("data-"):
|
||||
return True
|
||||
return name in acceptable_attributes
|
||||
|
||||
attributes = {"*": attributes_filter, "svg": svg_attributes}
|
||||
styles = bleach_allowlist.all_styles
|
||||
strip_comments = False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue