Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change Log
----------

1.2
~~~

Features:

* Add support for the ``<wbr>`` element, `which indicates a line break
opportunity <https://html.spec.whatwg.org/#the-wbr-element>`_. This element
is allowed by default by the sanitizer. (#395) (Thank you, Tom Most!)


1.1
~~~

Expand Down
3 changes: 2 additions & 1 deletion html5lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@
"col",
"input",
"source",
"track"
"track",
"wbr",
])

cdataElements = frozenset(['title', 'textarea'])
Expand Down
1 change: 1 addition & 0 deletions html5lib/filters/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
(namespaces['html'], 'ul'),
(namespaces['html'], 'var'),
(namespaces['html'], 'video'),
(namespaces['html'], 'wbr'),
(namespaces['mathml'], 'maction'),
(namespaces['mathml'], 'math'),
(namespaces['mathml'], 'merror'),
Expand Down
6 changes: 6 additions & 0 deletions html5lib/tests/test_sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ def test_data_uri_disallowed_type():
assert expected == sanitized


def test_wbr_allowed():
sanitized = sanitize_html('<wbr>')
expected = '<wbr/>'
assert expected == sanitized


def param_sanitizer():
for ns, tag_name in sanitizer.allowed_elements:
if ns != constants.namespaces["html"]:
Expand Down