Commits

Luke Plant committed 9749a3a

Fixed bug with HTML cleaning removing <br>'s with text beside them.

Comments (0)

Files changed (2)

semanticeditor/tests.py

         self.assertEqualClean("This is<br /><br />a test",
                               "<p>This is</p><p>a test</p>")
 
+    def test_br_in_p(self):
+        self.assertEqualClean("<p>line 1<br />line 2<br />line 3</p>",
+                              "<p>line 1<br />line 2<br />line 3</p>")
+
     def test_p_in_li(self):
         self.assertEqualClean("<ul><li><p>An item</p></li></ul>",
                               "<ul><li>An item</li></ul>")

semanticeditor/utils/presentation.py

             if pq(n).is_(blockdef_selector):
                 pull_up(n)
 
-    for x in ['br + br', 'p + br', 'p:empty']:
+    for x in ['p + br', 'p:empty']:
         doc(x).remove()
 
     # Removed elements can give problems which need to be fixed again.  We keep