diff --git a/CHANGES.rst b/CHANGES.rst index cf95ea0b..47dcda3a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,10 +11,15 @@ 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!) +* Add support for serializing the ``
    `` boolean attribute. (Thank + you, Tom Most!) (#396) +* The ``
      `` and ``
        `` attributes are now permitted by the + sanitizer. (#321) (Thank you, Tom Most!) Bug fixes: -* The sanitizer now permits ```` tags. +* The sanitizer now permits ```` tags. It used to allow ``
        `` + already. (#423) 1.1 ~~~ diff --git a/html5lib/constants.py b/html5lib/constants.py index e83bfb5d..2fa4146d 100644 --- a/html5lib/constants.py +++ b/html5lib/constants.py @@ -617,6 +617,7 @@ "button": frozenset(["disabled", "autofocus"]), "input": frozenset(["disabled", "readonly", "required", "autofocus", "checked", "ismap"]), "select": frozenset(["disabled", "readonly", "autofocus", "multiple"]), + "ol": frozenset(["reversed"]), "output": frozenset(["disabled", "readonly"]), "iframe": frozenset(["seamless"]), } diff --git a/html5lib/filters/sanitizer.py b/html5lib/filters/sanitizer.py index f7ac8d9b..81c85d44 100644 --- a/html5lib/filters/sanitizer.py +++ b/html5lib/filters/sanitizer.py @@ -365,6 +365,7 @@ (None, 'maxsize'), (None, 'minsize'), (None, 'other'), + (None, 'reversed'), (None, 'rowalign'), (None, 'rowalign'), (None, 'rowalign'), @@ -375,6 +376,7 @@ (None, 'scriptlevel'), (None, 'selection'), (None, 'separator'), + (None, 'start'), (None, 'stretchy'), (None, 'width'), (None, 'width'), diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py index a6cbd798..499310b6 100644 --- a/html5lib/tests/test_sanitizer.py +++ b/html5lib/tests/test_sanitizer.py @@ -154,3 +154,21 @@ def test_uppercase_color_codes_in_style(): sanitized = sanitize_html("

        ") expected = '

        ' assert expected == sanitized + + +def test_ol_start_allowed(): + sanitized = sanitize_html("
        1. .
        ") + expected = '
        1. .
        ' + assert expected == sanitized + + +def test_ol_type_allowed(): + sanitized = sanitize_html("
        1. .
        ") + expected = '
        1. .
        ' + assert expected == sanitized + + +def test_ol_reversed_allowed(): + sanitized = sanitize_html("
        1. .
        ") + expected = '
        1. .
        ' + assert expected == sanitized