P-wrapping tests to spec. existing behavior to assist Parsoid.
authorSubramanya Sastry <ssastry@wikimedia.org>
Fri, 21 Sep 2012 17:22:30 +0000 (12:22 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Fri, 21 Sep 2012 17:22:30 +0000 (12:22 -0500)
* Block tags on a line change paragraph wrapping behavior for
  that line and previous lines.  Added tests that captures how
  the PHP parser currently deals with it so that Parsoid can
  emulate this correctly.

Change-Id: I0bcddd2a6d64502d80f4a8155bcd1425bd5db7be

tests/parser/parserTests.txt

index aa084cc..43d4271 100644 (file)
@@ -510,7 +510,7 @@ Comment test 1
 !! end
 
 !! test
-Comment test 2
+Comment test 2a
 !! input
 asdf
 <!-- comment 1 -->
@@ -521,6 +521,19 @@ jkl
 </p>
 !! end
 
+!! test
+Comment test 2b
+!! input
+asdf
+<!-- comment 1 -->
+
+jkl
+!! result
+<p>asdf
+</p><p>jkl
+</p>
+!! end
+
 !! test
 Comment test 3
 !! input
@@ -633,6 +646,74 @@ b
 </p>
 !! end
 
+!! test
+Comment on its own line post-expand with non-significant whitespace
+!! input
+a
+ {{blank}} <!----> 
+b
+!! result
+<p>a
+</p><p>b
+</p>
+!! end
+
+###
+### paragraph wraping tests
+###
+!! test
+No block tags
+!! input
+a
+
+b
+!! result
+<p>a
+</p><p>b
+</p>
+!! end
+!! test
+Block tag on one line
+!! input
+a <div>foo</div>
+
+b
+!! result
+a <div>foo</div>
+<p>b
+</p>
+!! end
+
+!! test
+Block tag on both lines
+!! input
+a <div>foo</div>
+
+b <div>foo</div>
+!! result
+a <div>foo</div>
+b <div>foo</div>
+
+!! end
+
+!! test
+Multiple lines without block tags
+!! input
+<div>foo</div> a
+b
+c
+d<!--foo--> e
+x <div>foo</div> z
+!! result
+<div>foo</div> a
+<p>b
+c
+d e
+</p>
+x <div>foo</div> z
+
+!! end
+
 ###
 ### Preformatted text
 ###