Wouldn't it be nice if there was a simple way to parse user generated html and remove all the dangerous stuff? Bleach and nh3 are great libraries, but now there's a third: JustHTML! It has a policy based html sanitizer built in, that is enabled by default. It just works! :) Read more here: friendlybit.com/python/justhtm

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/EmilStenstrom/statuses/115799277243337914 on your instance and quote it. (Note that quoting is not supported in Mastodon.)