From 8079d4a7d1044f6d7b98af2fd7489f0d22ede01c Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 15 Apr 2014 12:21:29 -0400 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 207a3ba03b3a4371798c400092b76eb72b7034be Change-Id: I4bd0ba7a2671104809ad26bc66d38c7e678fa7b6 --- tests/parser/parserTests.txt | 537 +++++++++++++++++++++++++++++++---- 1 file changed, 488 insertions(+), 49 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index d958f92c46..ed9c03ce4e 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -522,27 +522,55 @@ Italics and bold: 2-quote opening sequence: (2,2) !! test Italics and bold: 2-quote opening sequence: (2,3) +!! options +parsoid=wt2html !! wikitext ''foo''' -!! html +!! html/*

foo'

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 2-quote opening sequence: (2,3) w/ nowiki +!! wikitext +''foo''' +!! html +

foo' +

+!! end + + !! test Italics and bold: 2-quote opening sequence: (2,4) +!! options +parsoid=wt2html !! wikitext ''foo'''' -!! html +!! html/*

foo''

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 2-quote opening sequence: (2,4) w/ nowiki +!! wikitext +''foo'''' +!! html +

foo'' +

+!! end + + # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 2-quote opening sequence: (2,5) +!! options +parsoid=wt2html !! wikitext ''foo''''' !! html/php @@ -553,6 +581,19 @@ Italics and bold: 2-quote opening sequence: (2,5)

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 2-quote opening sequence: (2,5+3) w/ nowiki +!! wikitext +''foo'''''''' +!! html/php +

foo +

+!! html/parsoid +

foo +

+!! end + ### ### 3-quote opening sequence tests @@ -580,17 +621,32 @@ Italics and bold: 3-quote opening sequence: (3,3) !! test Italics and bold: 3-quote opening sequence: (3,4) +!! options +parsoid=wt2html !! wikitext '''foo'''' -!! html +!! html/*

foo'

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 3-quote opening sequence: (3,4) w/ nowiki +!! wikitext +'''foo'''' +!! html +

foo' +

+!! end + + # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 3-quote opening sequence: (3,5) +!! options +parsoid=wt2html !! wikitext '''foo''''' !! html/php @@ -601,6 +657,19 @@ Italics and bold: 3-quote opening sequence: (3,5)

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 3-quote opening sequence: (3,5+2) w/ nowiki +!! wikitext +'''foo''''''' +!! html/php +

foo +

+!! html/parsoid +

foo +

+!! end + ### ### 4-quote opening sequence tests @@ -608,14 +677,27 @@ Italics and bold: 3-quote opening sequence: (3,5) !! test Italics and bold: 4-quote opening sequence: (4,2) +!! options +parsoid=wt2html !! wikitext ''''foo'' -!! html +!! html/*

''foo

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki +!! wikitext +''''foo'' +!! html +

''foo +

+!! end + + !! test Italics and bold: 4-quote opening sequence: (4,3) !! wikitext @@ -628,17 +710,32 @@ Italics and bold: 4-quote opening sequence: (4,3) !! test Italics and bold: 4-quote opening sequence: (4,4) +!! options +parsoid=wt2html !! wikitext ''''foo'''' -!! html +!! html/*

'foo'

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki +!! wikitext +''''foo'''' +!! html +

'foo' +

+!! end + + # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 4-quote opening sequence: (4,5) +!! options +parsoid=wt2html !! wikitext ''''foo''''' !! html/php @@ -649,6 +746,19 @@ Italics and bold: 4-quote opening sequence: (4,5)

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 4-quote opening sequence: (4,5+2) w/ nowiki +!! wikitext +''''foo''''''' +!! html/php +

'foo +

+!! html/parsoid +

'foo +

+!! end + ### ### 5-quote opening sequence tests @@ -657,34 +767,74 @@ Italics and bold: 4-quote opening sequence: (4,5) !! test Italics and bold: 5-quote opening sequence: (5,2) !! options +parsoid=wt2html !! wikitext '''''foo'' -!! html +!! html/*

foo

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +# skipping wt2html and html2html because it wants to put before +!! test +Italics and bold: 5-quote opening sequence: (5,2+3) +!! options +parsoid=wt2wt,html2wt +!! wikitext +'''''foo''''' +!! html/* +

foo +

+!! end + !! test Italics and bold: 5-quote opening sequence: (5,3) +!! options +parsoid=wt2html !! wikitext '''''foo''' -!! html +!! html/*

foo

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 5-quote opening sequence: (5,3+2) +!! wikitext +'''''foo''''' +!! html +

foo +

+!! end + + !! test Italics and bold: 5-quote opening sequence: (5,4) +!! options +parsoid=wt2html !! wikitext '''''foo'''' -!! html +!! html/*

foo'

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: 5-quote opening sequence: (5,4+2) w/ nowiki +!! wikitext +'''''foo'''''' +!! html +

foo' +

+!! end + + !! test Italics and bold: 5-quote opening sequence: (5,5) !! wikitext @@ -699,37 +849,78 @@ Italics and bold: 5-quote opening sequence: (5,5) ### !! test Italics and bold: multiple quote sequences: (2,4,2) +!! options +parsoid=wt2html !! wikitext ''foo''''bar'' -!! html +!! html/*

foo'bar

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki +!! wikitext +''foo''''bar''''' +!! html +

foo'bar +

+!! end + + !! test Italics and bold: multiple quote sequences: (2,4,3) +!! options +parsoid=wt2html !! wikitext ''foo''''bar''' -!! html +!! html/*

foo'bar

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki +!! wikitext +''foo''''bar''''' +!! html +

foo'bar +

+!! end + + !! test Italics and bold: multiple quote sequences: (2,4,4) +!! options +parsoid=wt2html !! wikitext ''foo''''bar'''' -!! html +!! html/*

foo'bar'

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki +!! wikitext +''foo''''bar'''''' +!! html +

foo'bar' +

+!! end + + # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: multiple quote sequences: (3,4,2) +!! options +parsoid=wt2html !! wikitext '''foo''''bar'' !! html/php @@ -740,10 +931,27 @@ Italics and bold: multiple quote sequences: (3,4,2)

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki +!! options +parsoid +!! wikitext +'''foo''''bar'''' +!! html/php +

foo'bar +

+!! html/parsoid +

foo'bar +

+!! end + # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: multiple quote sequences: (3,4,3) +!! options +parsoid=wt2html !! wikitext '''foo''''bar''' !! html/php @@ -754,6 +962,19 @@ Italics and bold: multiple quote sequences: (3,4,3)

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki +!! wikitext +'''foo''''bar'''''' +!! html/php +

foo'bar +

+!! html/parsoid +

foo'bar +

+!! end + ### ### other quote tests ### @@ -779,14 +1000,30 @@ Italics and bold: other quote tests: (2,(3,3),2) !! test Italics and bold: other quote tests: (3,2,3,2) +!! options +parsoid=wt2html !! wikitext '''this is about ''foo'''s family'' -!! html +!! html/*

this is about foos family

!!end +# same html as previous, but wikitext adjusted to match parsoid html2wt +# add 'parsoid' option to use 'parsoid' normalization of the placeholder +!! test +Italics and bold: other quote tests: (3,2,3+2+2,2) +!! options +parsoid +!! wikitext +'''this is about ''foo'''''''s family'' +!! html/* +

this is about foos family +

+!! end + + !! test Italics and bold: other quote tests: (3,2,3,3) !! options @@ -1198,6 +1435,22 @@ b

!! end +!! test +Multiple comments should still parse as SOL-transparent +!! options +parsoid=wt2html,wt2wt +!! wikitext +*a +*b +!! html +
    +
  • a +
  • +
  • b +
  • +
+!! end + ### ### paragraph wrapping tests ### @@ -1899,6 +2152,29 @@ bar

!! end +!! test +Templates: Handle comments in the target +!! wikitext +{{echo + +|foo}} + +{{echo +|foo}} + +{{echo|foo}} + +{{echo|foo}} +!!html/parsoid +

foo

+ +

foo

+ +

foo

+ +

foo

+!!end + #-------------------------------------------------------------------- # Transclusion parameter escaping tests #-------------------------------------------------------------------- @@ -5512,6 +5788,17 @@ language=kaa

!! end +!! test +Link with multiple ":" in a subpage-supporting namespace (bug 63636) +!! wikitext +[[User:Foo/Test/63636:Bar|Test]] +!! html/php +

Test +

+!! html/parsoid +

Test

+!! end + !! test 1. Interaction of linktrail and template encapsulation !! options @@ -5682,16 +5969,30 @@ Interwiki link with fragment (bug 2130) # Ideally the wikipedia: prefix here should be proto-relative too !! test Different interwiki prefixes mapping to the same URL -!! options -parsoid !! wikitext +[[:en:Foo]] + +[[:en:Foo|Foo]] + [[wikipedia:Foo]] -[[:en:Foo]] -!! html -

wikipedia:Foo

+[[:wikipedia:Foo|Foo]] + +[[wikipedia:en:Foo]] +[[:wikipedia:en:Foo]] +!! html/parsoid

en:Foo

+ +

Foo

+ +

wikipedia:Foo

+ +

Foo

+ +

wikipedia:en:Foo

+ +

wikipedia:en:Foo

!! end !! test @@ -10800,48 +11101,36 @@ valign, and caption (existing content) !! test Parsoid-specific image handling - framed image with specific size and caption +(size is ignored) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|frame|500x50px|caption]] +[[File:Foobar.jpg|frame|500x50px|caption]] !! html/parsoid
- +
caption
!! end -!! test -Parsoid-specific image handling - framed image with specific size and caption -(existing content) -!! wikitext -[[File:Foobar.jpg|442x50px|frame|caption]] -!! html/parsoid -
caption
-!! end - !! test Parsoid-specific image handling - framed image with specific size, halign, valign, and caption +(size is ignored) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|left|baseline|frame|500x50px|caption]] +[[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] !! html/parsoid
- +
caption
!! end -!! test -Parsoid-specific image handling - framed image with specific size, halign, -valign, and caption (existing content) -!! wikitext -[[File:Foobar.jpg|442x50px|frame|left|baseline|caption]] -!! html/parsoid -
caption
-!! end - !! test Parsoid-specific image handling - frameless image with specific size, border, and caption !! wikitext @@ -10884,13 +11173,33 @@ bar !! end !! test -Parsoid-specific image handling - empty caption +Parsoid-specific image handling - empty caption (1) +!! options +parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! html/parsoid
!! end +# empty captions don't get serialized unless we're in the "round trip" case +!! test +Parsoid-specific image handling - empty caption (2) +!! options +parsoid=html2wt +!! html/parsoid +
+ + + +
+
+!! wikitext +[[File:Foobar.jpg|thumb]] +!! end + !! test Parsoid-specific image handling - whitespace caption !! wikitext @@ -10958,22 +11267,78 @@ subpage title=[[Subpage test/1/2/3/4]]

Subpage_test/1/2/subpage

!! end -# TODO: make this PHP-parser compatible! !! test Parsoid: dot-slash prefixed wikilinks -!! options -parsoid=wt2wt,wt2html,html2html !! wikitext [[./foo]] [[././bar]] [[././baz/]] -!! html -

foo

-

bar

-

baz/

-!! end +!! html/php +

[[./foo]] +

[[././bar]] +

[[././baz/]] +

+!! html/parsoid +

[[./foo]] +

[[././bar]] +

[[././baz/]] +

+!! end + +!! test +Render invalid page names as plain text (bug 51090) +!! wikitext +[[./../foo|bar]] +[[foo�|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~bar]] +[[foo>bar]] +[[foo[bar]] +[[.]] +[[..]] +[[foo././bar]] + +[[{{echo|./../foo}}|bar]] +[[{{echo|foo/.}}|bar]] +[[{{echo|foo/..}}|bar]] +[[{{echo|foo~~~~bar}}]] +[[{{echo|foo>bar}}]] +[[{{echo|foo././bar}}]] +[[{{echo|foo{bar}}]] +[[{{echo|foo}bar}}]] +[[{{echo|foo[bar}}]] +[[{{echo|foo]bar}}]] +[[{{echo|foo[[./../foo|bar]] +[[foo�|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~bar]] +[[foo>bar]] +[[foo[bar]] +[[.]] +[[..]] +[[foo././bar]] +

[[./../foo|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~~bar]] +[[foo>bar]] +[[foo././bar]] +[[foo{bar]] +[[foo}bar]] +[[foo[bar]] +[[foo]bar]] +[[foo<bar]] +

+!!html/parsoid +

[[./../foo|bar]][[foo�|bar]][[foo/.|bar]][[foo/..|bar]][[foo~~~bar]][[foo>bar]][[foo[bar]][[.]][[..]][[foo././bar]]

+

[[./../foo|bar]][[foo/.|bar]][[foo/..|bar]][[foo~~~~bar]][[foo>bar]][[foo././bar]][[foo{bar]][[foo}bar]][[foo[bar]][[foo]bar]][[foo<bar]]

+!!end !! test Disabled subpages @@ -11715,6 +12080,23 @@ __NOEDITSECTION__ !! end +!! test +Single-line or multiline-comments can follow headings +!! options +parsoid=wt2html,wt2wt +!! wikitext +==foo== +==bar== +==baz== +!! html +

foo

+

bar

+

baz

+ +!! end + !! test BUG 1219 URL next to image (broken) !! wikitext @@ -14373,6 +14755,8 @@ Handling of in URLs # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test 5 quotes, code coverage +1 line +!! options +parsoid=wt2html !! wikitext ''''' !! html/php @@ -14380,6 +14764,33 @@ Handling of in URLs

!! end +# same html as previous, but wikitext adjusted to match parsoid html2wt +# note that wt2html and html2html will put the before the +!! test +5 quotes, code coverage +1 line w/ nowiki (1) +!! options +parsoid=wt2wt,html2wt +!! wikitext +'''''''''' +!! html/php +

+

+!! html/parsoid +

+!! end + +# same as previous, just swapping the and +!! test +5 quotes, code coverage +1 line w/ nowiki (2) +!! wikitext +'''''''''' +!! html/php +

+

+!! html/parsoid +

+!! end + !! test Special:Search page linking. !! wikitext @@ -19139,6 +19550,23 @@ parsoid !!end +!! test +New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly +!! options +parsoid=html2wt +!! wikitext +foo +new para + +[[./Category:Foo]] + += new heading = +!! html +

new para

+ +

new heading

+!! end + ## PHP emits broken html for this, and since this is primarily ## a Parsoid serializer test, marking this Parsoid only !!test @@ -19165,7 +19593,7 @@ parsoid !!end -## Currently the p-wrapper is fragile in how adds / removes transformations. +## Currently the p-wrapper is fragile in how it adds / removes transformations. ## Having nested or stray pre tags results in the attempt to add duplicates, ## causing an assertion fail. This test tries to prevent that situation. !!test @@ -19379,6 +19807,17 @@ parsoid=wt2wt,wt2html b !!end +!!test +9. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!! wikitext +{{echo|hi
hello}} +!! html +hi +
hello +!!end + !!test Table in fosterable position !!options -- 2.20.1