]> gitweb.fperrin.net Git - djsite.git/blobdiff - quotes/localmodels.py
Limit tags from tinymce and use strip in bleach rather than replace
[djsite.git] / quotes / localmodels.py
index c09f7710361be183be7112d39f2396c45db73bfd..691ea8cc6421c13ad3c43bececf5f8e61d935e96 100644 (file)
@@ -2,7 +2,8 @@ import tinymce.models
 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):