diff --git a/AUTHORS.rst b/AUTHORS.rst index c3820ef7..5623e03a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -42,3 +42,4 @@ Patches and suggestions - Michael[tm] Smith - Marc Abramowitz - Jon Dufresne +- Jonathan Vanasco diff --git a/CHANGES.rst b/CHANGES.rst index 570c9605..f2591d2f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,12 @@ Change Log ---------- +unreleased +~~~~~~~~~~~~~~~~~~ + +* Added `itemscope` as boolean attribute + https://github.com/html5lib/html5lib-python/issues/194 + 0.999999999/1.0b10 ~~~~~~~~~~~~~~~~~~ diff --git a/html5lib/constants.py b/html5lib/constants.py index 9e7541d3..975aa021 100644 --- a/html5lib/constants.py +++ b/html5lib/constants.py @@ -588,7 +588,7 @@ ]) booleanAttributes = { - "": frozenset(["irrelevant"]), + "": frozenset(["irrelevant", "itemscope"]), "style": frozenset(["scoped"]), "img": frozenset(["ismap"]), "audio": frozenset(["autoplay", "controls"]), diff --git a/html5lib/tests/serializer-testdata/options.test b/html5lib/tests/serializer-testdata/options.test index eedcb3f0..a22eebfc 100644 --- a/html5lib/tests/serializer-testdata/options.test +++ b/html5lib/tests/serializer-testdata/options.test @@ -46,6 +46,29 @@ "quote_attr_values": "always" } }, + { + "expected": [ + "
" + ], + "input": [ + [ + "StartTag", + "http://www.w3.org/1999/xhtml", + "div", + [ + { + "namespace": null, + "name": "itemscope", + "value": "itemscope" + } + ] + ] + ], + "description": "quote_attr_values='always' with itemscope", + "options": { + "quote_attr_values": "always" + } + }, { "expected": [ "
" @@ -171,6 +194,29 @@ "use_trailing_solidus": true } }, + { + "expected": [ + "
" + ], + "input": [ + [ + "StartTag", + "http://www.w3.org/1999/xhtml", + "div", + [ + { + "namespace": null, + "name": "itemscope", + "value": "itemscope" + } + ] + ] + ], + "description": "minimize_boolean_attributes=false", + "options": { + "minimize_boolean_attributes": false + } + }, { "expected": [ "
" @@ -194,6 +240,29 @@ "minimize_boolean_attributes": false } }, + { + "expected": [ + "
" + ], + "input": [ + [ + "StartTag", + "http://www.w3.org/1999/xhtml", + "div", + [ + { + "namespace": null, + "name": "itemscope", + "value": "" + } + ] + ] + ], + "description": "minimize_boolean_attributes=false with empty value", + "options": { + "minimize_boolean_attributes": false + } + }, { "expected": [ "
"