Skip to content

Add attribute wildcards, e.g., for HTML5 data-* #2229

Closed as duplicate of#499
Closed as duplicate of#499
@beargiles

Description

@beargiles

Discussed in #2224

Originally posted by beargiles November 15, 2024
Applications have defined custom attributes for a long time, e.g., aria-*, and with HTML5 (iirc) there's now an official standard to recognize data-* as a valid attribute. For example aria-xyz should become data-aria-xyz.

It's not practical to add all possible attributes - it's an undefined list - and we don't want to specify :all since that will include everything. The best solution appears to be adding an optional list of java.text.Pattern objects to the Safelist and adding a check for matches.

I propose adding both per-tag and global attribute wildcards.

Code to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions