-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Hope v1.0.0 can set the whitelist of the elements #223
Comments
For what use-case do you need a white list of elements? |
If just allow a, div, img three elements,
now only the blacklist, so I need to set a huge list to arrived the same
effect with the whitelist.
The blacklist looks like ['span', 'h1', 'h2', 'h3', 'iframe', 'video', 'embed', 'ul', 'li']
The whitelist very simple, looks like ['a', 'div', 'img']
|
Unless we find other people supporting this, I doubt whether we will implement this. Not only can you blacklist elements you don't want (granted, a bit tedious) or sanitize the html yourself before feeding it to flutter_html (granted, a bit cumbersome), but the usage for an include list seems very small in scope. |
I was just thinking about this - what if we exposed a getter with all the supported HTML tags to help with this. The implementation could look like this: Html(
tagsList: Html.tags.remove(/*tags to remove*/) or ['a', 'div', 'img']
); The first case blacklists and the second case whitelists. This would be a breaking change though, but definitely not too hard to implement. I can't think of any caveats in my mind either (aside from users whitelisting unsupported tags but even then they would just be ignored right?) |
Set up the whitelist easier than the blacklist
The text was updated successfully, but these errors were encountered: