8000 support `itemscope` as a boolean attribute · Issue #194 · html5lib/html5lib-python · GitHub
[go: up one dir, main page]

Skip to content
support itemscope as a boolean attribute #194
Closed
@jvanasco

Description

@jvanasco

itemscope should be supported as a boolean attribute.

for reference, schema.org has been pushing it as such (https://schema.org/docs/gs.html#microdata_itemscope_itemtype)

running something through the Tokenizer/Sanitizer will set it to an empty attribute

input: <article itemscope>
output: <article itemscope="">

it looks like this can be handled by editing constants.py and doing the following to enable it on all tags:

booleanAttributes = {
-    "": frozenset(["irrelevant"]),
+    "": frozenset(["irrelevant", "itemscope"]),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0