rust-ammonia / ammonia

Repair and secure untrusted HTML
Apache License 2.0
524 stars 43 forks source link

Setting to allow custom elements #203

Open knowler opened 2 months ago

knowler commented 2 months ago

Is your feature request related to a problem? Please describe.

I’d like to allow custom elements. The problem is that I can’t know what custom elements will be used so I can’t add them to the tags.

Describe the solution you'd like

Perhaps a simple boolean for allowing custom elements or not. Perhaps it could even allow for a regex or something to filter out custom elements that don’t make a certain pattern (e.g. my-*).

Describe alternatives you've considered

I could parse it first to find all of the custom elements to add to the builder, but it would be nice to not parse twice.