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: https://friendlybit.com/python/justhtml-sanitization/