Skip to content

Instantly share code, notes, and snippets.

@maxp
Created January 24, 2012 03:51
Show Gist options
  • Save maxp/1667689 to your computer and use it in GitHub Desktop.
Save maxp/1667689 to your computer and use it in GitHub Desktop.
import jinja2
import scrubber # http://pypi.python.org/pypi/scrubber
def sanitize_html(text):
return jinja2.Markup(scrubber.Scrubber().scrub(text))
jinja_env.filters['sanitize_html'] = sanitize_html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment