-
Notifications
You must be signed in to change notification settings - Fork 8
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
Validate custom elements in configuration #33
Comments
_transformConfig
@0xedward does this mean that this polyfill does not work at all now if using Custom Elements? So this issue needs to be implemented before it can be used in projects using Custom Elements? |
Hey @thernstig, it's been a while since I worked on this, so my memory might be a bit faulty. The polyfill basically converts the Here's some code pointers for what I mentioned: sanitizer-polyfill/src/sanitizer.js Lines 18 to 20 in 319b7a4
sanitizer-polyfill/src/sanitizer.js Lines 130 to 161 in 319b7a4
|
FWIW, I would not recommend using this polyfill in any kind of production setup. The Sanitizer API is still under heavy development and we're changing quite a few things (e.g., the config syntax in WICG/sanitizer-api#181) |
When the user specifies set
allowCustomElements
totrue
in sanitizer configuration, we want to allow list all custom elements.When
allowCustomElements === false
, we want to remove all custom elements fromallowElements
.When
allowCustomElements === true
, we want to check all elements inallowElements
are part of https://wicg.github.io/sanitizer-api/#baseline-elements and keep all custom elements inallowElements
. We can construct a regex from https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name to determine if an element is a custom elementFor example:
The text was updated successfully, but these errors were encountered: