Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def remove_empty_paragraphs(text):
    doc = html.fragment_fromstring(text, create_parent=True)
    for element in doc.cssselect('p'):
        text = element.text_content()
        text = text.strip()
        if text == '' and len(element) == 0:
    return _tostring(doc)

src/d/j/django-form-extensions-0.1.2b4/form_extensions/fields.py   django-form-extensions(Download)
from django.core.exceptions import ValidationError
from django.core import validators
from form_extensions.utils import bleach, replace_elements, remove_empty_paragraphs
import re
    def clean(self, value):
        value = replace_elements(value, self.element_replacements)
        value = remove_empty_paragraphs(value)
        value = bleach(value, self.allowed_tags, self.allowed_attributes, self.allowed_styles)
        return super(HTMLField, self).clean(value)