diff --git a/CHANGES.rst b/CHANGES.rst index 3ed63a96..f28caa86 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,13 @@ Change Log ---------- +1.2 +~~~ + +Bug fixes: + +* The sanitizer now permits ```` tags. + 1.1 ~~~ @@ -22,7 +29,6 @@ Other changes: ``html5lib`` keeps working in future Python versions. (#403) * Drop optional ``datrie`` dependency. (#442) - 1.0.1 ~~~~~ diff --git a/html5lib/filters/sanitizer.py b/html5lib/filters/sanitizer.py index 70ef9066..684f2172 100644 --- a/html5lib/filters/sanitizer.py +++ b/html5lib/filters/sanitizer.py @@ -113,6 +113,7 @@ (namespaces['html'], 'strike'), (namespaces['html'], 'strong'), (namespaces['html'], 'sub'), + (namespaces['html'], 'summary'), (namespaces['html'], 'sup'), (namespaces['html'], 'table'), (namespaces['html'], 'tbody'), diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py index 6ad43a3a..9deed6f5 100644 --- a/html5lib/tests/test_sanitizer.py +++ b/html5lib/tests/test_sanitizer.py @@ -111,6 +111,18 @@ def param_sanitizer(): """foo""" % (protocol, rest_of_uri)) +def test_details_open_allowed(): + sanitized = sanitize_html("
.
") + expected = '
.
' + assert expected == sanitized + + +def test_details_summary_allowed(): + sanitized = sanitize_html("
.

...

") + expected = '
.

...

' + assert expected == sanitized + + @pytest.mark.parametrize("expected, input", (pytest.param(expected, input, id=id) for id, expected, input in param_sanitizer()))