Curated lists of tags and attributes for sanitizing html
A curated list of tags, attributes, and styles suitable for filtering user-provided HTML using bleach.
Currently, it consists of basic set of tags suitable for rendering markdown, and markup intended for printing, as well as a list of all CSS styles. Please send pull requests with improvements or lists of tags and attributes for other purposes (wikis, comments, etc?).
pip install bleach-whitelist
import bleach from bleach_whitelist import print_tags, print_attrs, all_styles bleach.clean(raw_html, print_tags, print_attrs, all_styles)
See bleach_whitelist.py for more.
Have improvements or lists of tags suitable for other purposes? Please send a pull request! Let’s build a few good task-specific whitelists rather than reinventing these lists every time.