Skip to content

ARIA related attributes are dropped by sanitizer #399

Open
@tushuhei

Description

@tushuhei

When I serialize a HTML document including elements with ARIA related attributes, serialize method drops them off as a result of sanitization.

import html5lib
doc = '<div id="foo">the description</div><span aria-describedby="foo">bar</span>'
print(html5lib.serialize(html5lib.parseFragment(doc),
                         sanitize=True, quote_attr_values='always'))
# <div id="foo">the description</div><span>bar</span>

ARIA related attributes are not dangerous for my understanding, so serialize method should keep them even if the parameter sanitize is True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions