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

Hope v1.0.0 can set the whitelist of the elements #223

Closed
gzlock opened this issue Feb 3, 2020 · 4 comments · Fixed by #619
Closed

Hope v1.0.0 can set the whitelist of the elements #223

gzlock opened this issue Feb 3, 2020 · 4 comments · Fixed by #619

Comments

@gzlock
Copy link

gzlock commented Feb 3, 2020

Set up the whitelist easier than the blacklist

@Sub6Resources
Copy link
Owner

For what use-case do you need a white list of elements?

@gzlock
Copy link
Author

gzlock commented Feb 6, 2020 via email

@erickok
Copy link
Collaborator

erickok commented Feb 8, 2021

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.

@tneotia
Copy link
Collaborator

tneotia commented Apr 10, 2021

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?)

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

Successfully merging a pull request may close this issue.

4 participants