Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
powerful and slow arbitrary HTML sanitisation. can deal (i hope) with most XSS
vectors and layout-breaking badness.
Probably overkill for content from trusted sources; defaults are accordingly
set to be paranoid.
>>> bad_html = '<p style="forbidden markup"><!-- XSS attach -->content</p'
>>> good_html = u'<p>content</p>'
>>> c = Cleaner()
>>> c.string = bad_html
>>> c.clean()
>>> c.string == good_html(more...)

src/m/e/mediadrop-HEAD/mediadrop/lib/xhtml/__init__.py   mediadrop(Download)
from webhelpers import text
 
from mediadrop.lib.xhtml.htmlsanitizer import (Cleaner,
    entities_to_unicode as decode_entities,
    encode_xhtml_entities as encode_entities)
    # This is undesirable, so here we... just re-parse the markup.
    # But this ... could be pretty slow.
    cleaner = Cleaner(string, **_cleaner_settings)
    string = cleaner()