divio/django-cms — pull request #1534 by gustavodiazjaimes (2012-11-25 06:38:08+00:00)
Title: optional clean_html from settings

settings.CMS_CLEAN_HTML let you change the default html sanitizer

Now i can do this

# settings.py
...
from lxml.html.clean import Cleaner
def clean_html(data, **kwargs):
full = getattr(kwargs, 'full', True)
options = {"safe_attrs_only": False,
"page_structure": full}
return Cleaner(**options).clean_html(data)

CMS_CLEAN_HTML = clean_html