Bleach: HTML Sanitization

Posted on Mon 03 January 2011 in Dispatches • Tagged with development, html, python, security • 1 min read

Bleach is a rather clever Python module for sanitizing HTML input and auto-linking URLs. It uses a whitelist for the allowed elements and attributes (thank God), and will avoid trying to “linkify” URLs that are already within an anchor element. The way it pulls this off is to build an …

Continue reading