Commits

Anonymous committed d7f869a

check paragraphs for children before considering them empty

Comments (0)

Files changed (1)

form_extensions/utils.py

     for element in doc.cssselect('p'):
         text = element.text_content()
         text = text.strip()
-        if text == '':
+        if text == '' and len(element) == 0:
             element.drop_tree()
     return _tostring(doc)