Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ Patches and suggestions
- Michael[tm] Smith
- Marc Abramowitz
- Jon Dufresne
- Jonathan Vanasco
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
----------

unreleased
~~~~~~~~~~~~~~~~~~

* Added `itemscope` as boolean attribute
https://github.com/html5lib/html5lib-python/issues/194

0.999999999/1.0b10
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion html5lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
])

booleanAttributes = {
"": frozenset(["irrelevant"]),
"": frozenset(["irrelevant", "itemscope"]),
"style": frozenset(["scoped"]),
"img": frozenset(["ismap"]),
"audio": frozenset(["autoplay", "controls"]),
Expand Down
69 changes: 69 additions & 0 deletions html5lib/tests/serializer-testdata/options.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@
"quote_attr_values": "always"
}
},
{
"expected": [
"<div itemscope>"
],
"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": [
"<div irrelevant>"
Expand Down Expand Up @@ -171,6 +194,29 @@
"use_trailing_solidus": true
}
},
{
"expected": [
"<div itemscope=itemscope>"
],
"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": [
"<div irrelevant=irrelevant>"
Expand All @@ -194,6 +240,29 @@
"minimize_boolean_attributes": false
}
},
{
"expected": [
"<div itemscope=\"\">"
],
"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": [
"<div irrelevant=\"\">"
Expand Down