Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
beargiles opened this issue Nov 16, 2024 Discussed in #2224 · 0 comments
Open

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

beargiles opened this issue Nov 16, 2024 Discussed in #2224 · 0 comments

Comments

@beargiles
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant