diff --git a/CHANGES.rst b/CHANGES.rst index f28caa86..cf95ea0b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,14 @@ Change Log 1.2 ~~~ +Unreleased yet + +Features: + +* Add support for the ```` element in the sanitizer, `which indicates + a line break opportunity `_. + This element is allowed by default. (#395) (Thank you, Tom Most!) + Bug fixes: * The sanitizer now permits ```` tags. @@ -11,6 +19,8 @@ Bug fixes: 1.1 ~~~ +Released on June 23, 2020 + Breaking changes: * Drop support for Python 3.3. (#358) diff --git a/html5lib/constants.py b/html5lib/constants.py index fe3e237c..11184e0d 100644 --- a/html5lib/constants.py +++ b/html5lib/constants.py @@ -571,7 +571,8 @@ "col", "input", "source", - "track" + "track", + "wbr", ]) cdataElements = frozenset(['title', 'textarea']) diff --git a/html5lib/filters/sanitizer.py b/html5lib/filters/sanitizer.py index 684f2172..f7ac8d9b 100644 --- a/html5lib/filters/sanitizer.py +++ b/html5lib/filters/sanitizer.py @@ -129,6 +129,7 @@ (namespaces['html'], 'ul'), (namespaces['html'], 'var'), (namespaces['html'], 'video'), + (namespaces['html'], 'wbr'), (namespaces['mathml'], 'maction'), (namespaces['mathml'], 'math'), (namespaces['mathml'], 'merror'), diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py index 9deed6f5..a6cbd798 100644 --- a/html5lib/tests/test_sanitizer.py +++ b/html5lib/tests/test_sanitizer.py @@ -55,6 +55,12 @@ def test_data_uri_disallowed_type(): assert expected == sanitized +def test_wbr_allowed(): + sanitized = sanitize_html('') + expected = '' + assert expected == sanitized + + def param_sanitizer(): for ns, tag_name in sanitizer.allowed_elements: if ns != constants.namespaces["html"]: