import bleach
def valid_html(value):
- return bleach.clean(value, bleach.ALLOWED_TAGS + ['p', 'br'])
+ return bleach.clean(value, bleach.ALLOWED_TAGS + ['p', 'br'],
+ strip=True, strip_comments=True)
class HTMLField(tinymce.models.HTMLField):
def pre_save(self, model_instance, add):