Commits

Viliam Segeda  committed 8931421

fix for issue #32 - disappearing paragraphs

  • Participants
  • Parent commits a4f087e

Comments (0)

Files changed (1)

File semanticeditor/utils/presentation.py

             if (j > 0): # skip the first one
                 del node.attrib['id']
 
-    for x in ['p + br', 'p:empty']:
-        doc(x).remove()
-
+    #for x in ['p + br', 'p:empty']:
+    doc('p + br').remove()
+    for par in doc('p:empty'):
+        if par.text is None  or par.text.strip() == "":
+            par.getparent().remove(par)
+            
     # Removed elements can give problems which need to be fixed again.  We keep
     # iterating through this until we get the same answer!
     output_html = _html_extract(root)