From 792fbdb17fd0b6c41eca1d1258e41394337e16a7 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 6 Mar 2017 12:06:33 -0500 Subject: [PATCH] added `itemscope` as a boolean attribute (issue #194) --- AUTHORS.rst | 1 + CHANGES.rst | 6 ++ html5lib/constants.py | 2 +- .../tests/serializer-testdata/options.test | 69 +++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) 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": [ "
" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy