html-stripping-examples

Jump to: navigation, search

This page documents existing library code that strips elements and attributes from HTML for "safe" display of HTML (e.g. for embedding).

Contents

jsoup (Java)

Details

Problems: doesn't support new elements defined in HTML5.

AntiSamy Project (Java, .NET)

Homepage, Download page on Google Code

Different profiles can be defined in an XML file. The distribution contains the following sample profiles:

HTML Purifier (PHP)

Homepage, GitHub

HTML Purifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant, something only achievable with a comprehensive knowledge of W3C's specifications.

Django-Bleach (Python/Django)

Github repository

html5lib-based.

See also

html-stripping-examples was last modified: Sunday, September 15th, 2013

Views