Skip to content

Commit bbfa7a8

Browse files
committed
sanitizer: Allow <wbr> elements by default
<wbr> is a safe element, so let it be.
1 parent 950ea0e commit bbfa7a8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

html5lib/filters/sanitizer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
(namespaces['html'], 'ul'),
112112
(namespaces['html'], 'var'),
113113
(namespaces['html'], 'video'),
114+
(namespaces['html'], 'wbr'),
114115
(namespaces['mathml'], 'maction'),
115116
(namespaces['mathml'], 'math'),
116117
(namespaces['mathml'], 'merror'),

html5lib/tests/test_sanitizer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def test_data_uri_disallowed_type():
5959
assert expected == sanitized
6060

6161

62+
def test_wbr_allowed():
63+
sanitized = sanitize_html('<wbr>')
64+
expected = '<wbr>'
65+
assert expected == sanitized
66+
67+
6268
def test_sanitizer():
6369
for ns, tag_name in sanitizer.allowed_elements:
6470
if ns != constants.namespaces["html"]:

0 commit comments

Comments
 (0)