New paragraphs wrapping tests in the presence of comments & WS lines.
authorSubramanya Sastry <ssastry@wikimedia.org>
Fri, 22 Mar 2013 18:36:20 +0000 (13:36 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Fri, 22 Mar 2013 18:36:20 +0000 (13:36 -0500)
Change-Id: I3654f28846cce321ea97f70389cabe11b2786082

tests/parser/parserTests.txt

index 7dcbeed..e28074e 100644 (file)
@@ -164,6 +164,145 @@ baz
 </p>
 !! end
 
+!! test
+Paragraphs with newline spacing with comment lines in between
+!! input
+----
+a
+<!--foo-->
+b
+----
+a
+<!--foo--><!--More than 1 comment disables stripping of this line!-->
+b
+----
+a
+<!--foo-->
+
+b
+----
+a
+
+<!--foo-->
+b
+----
+a
+<!--foo-->
+
+
+b
+----
+a
+
+
+<!--foo-->
+b
+----
+!! result
+<hr />
+<p>a
+b
+</p>
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p><br />
+b
+</p>
+<hr />
+<p>a
+</p><p><br />
+b
+</p>
+<hr />
+
+!! end
+
+!! test
+Paragraphs with newline spacing with non-empty white-space lines in between
+!! input
+----
+a
+b
+----
+a
+b
+----
+!! result
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p><br /> 
+b
+</p>
+<hr />
+
+!! end
+
+!! test
+Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between
+!! input
+----
+a
+ <!--foo-->
+b
+----
+a
+ <!--foo--><!--More than 1 comment disables stripping of this line!-->
+b
+----
+a
+<!--foo-->
+ <!--bar-->
+b
+----
+a
+ <!--foo-->
+ <!--bar-->
+b
+----
+!! result
+<hr />
+<p>a
+b
+</p>
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p>b
+</p>
+<hr />
+<p>a
+</p><p><br /> 
+b
+</p>
+<hr />
+
+!! end
+
 !! test
 Parsing an URL
 !! input