From 3bf46cc4eae7fe8833a27779e6aa77fff9623871 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian"
foo'
!! end - !! test Italics and bold: 2-quote opening sequence: (2,4) !! options @@ -573,18 +570,16 @@ parsoid=wt2html !!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''
!! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 2-quote opening sequence: (2,5) @@ -620,13 +615,24 @@ Italics and bold: 2-quote opening sequence: (2,5+3) w/ nowiki !! test Italics and bold: 3-quote opening sequence: (3,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: 3-quote opening sequence: (3,2) w/ nowiki +!! wikitext +''foo +
+!!end !! test Italics and bold: 3-quote opening sequence: (3,3) @@ -637,7 +643,6 @@ Italics and bold: 3-quote opening sequence: (3,3) !!end - !! test Italics and bold: 3-quote opening sequence: (3,4) !! options @@ -649,18 +654,16 @@ parsoid=wt2html !!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'
!! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 3-quote opening sequence: (3,5) @@ -705,7 +708,6 @@ parsoid=wt2html !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki @@ -716,16 +718,26 @@ Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki !! end - !! test Italics and bold: 4-quote opening sequence: (4,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: 4-quote opening sequence: (4,3) w/ nowiki +!! wikitext +''foo +
+!!end !! test Italics and bold: 4-quote opening sequence: (4,4) @@ -738,18 +750,16 @@ parsoid=wt2html !!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'
!! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 4-quote opening sequence: (4,5) @@ -769,7 +779,7 @@ parsoid=wt2html !! test Italics and bold: 4-quote opening sequence: (4,5+2) w/ nowiki !! wikitext -''''foo''''''foo
@@ -794,7 +804,6 @@ parsoid=wt2html !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt # skipping wt2html and html2html because it wants to put before !! test @@ -819,7 +828,6 @@ parsoid=wt2html !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 5-quote opening sequence: (5,3+2) @@ -830,7 +838,6 @@ Italics and bold: 5-quote opening sequence: (5,3+2) !! end - !! test Italics and bold: 5-quote opening sequence: (5,4) !! options @@ -842,18 +849,16 @@ parsoid=wt2html !!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'
!! end - !! test Italics and bold: 5-quote opening sequence: (5,5) !! wikitext @@ -882,7 +887,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki !! wikitext -''foo'bar
@@ -905,7 +910,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki !! wikitext -''foo'bar
@@ -928,7 +933,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki !! wikitext -''foo'bar'
@@ -1030,14 +1035,11 @@ parsoid=wt2html # 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'''''this is about foos family
!! end @@ -1046,8 +1048,20 @@ parsoid !! test Italics and bold: other quote tests: (3,2,3,3) !! options +parsoid=wt2html !! wikitext '''this is about ''foo'''s family''' +!! html/* +'this is about foos family +
+!!end + + +# same html as previous, but wikitext adjusted to match parsoid html2wt +!! test +Italics and bold: other quote tests: (3,2,3,3) w/ nowiki +!! wikitext +''this is about foos family
@@ -1776,7 +1790,7 @@ b ## of eager output of buffered tokens in the p-wrapper. But, I'm going to ignore ## them for now. !! test -P-wrapping should leave sol-transparent tags outside p-tags where possible +1. P-wrapping should leave sol-transparent tags outside p-tags where possible !! options parsoid=wt2html !! wikitext @@ -1788,6 +1802,16 @@ a [[Category:A1]] [[Category:A2]] !! end +!! test +2. P-wrapping should leave sol-transparent tags outside p-tags where possible +!! options +parsoid=wt2html +!! wikitext +[[Category:A1]]a +!! html/parsoid +a
+!! end + ### ### Preformatted text ### @@ -2244,7 +2268,8 @@ parsoid=wt2html<pre
x+
x+
<pre
@@ -2423,6 +2448,41 @@ Templates: Handle comments in the targetfoo
!!end +!! test +Templates: Handle comments in parameter names (bug 67657) +!! wikitext +{{echo|1 + +=foo}} + +{{echo| + +1 = foo}} + +{{echo|1 = foo}} + +{{echo|1 = foo}} +!!html/parsoid +foo
+ +foo
+ +foo
+ +foo
+!!end + +!! test +Templates: Other wikitext in parameter names (bug 67657) +!! wikitext +{{echo|''1''=foo}} +!!html/parsoid +{{{1}}}
+!!html/php +{{{1}}} +
+!!end + #-------------------------------------------------------------------- # Transclusion parameter escaping tests #-------------------------------------------------------------------- @@ -5465,6 +5525,9 @@ Template-generated table cell attributes and cell content {| |{{table_attribs}} | {{table_attribs}} +| {{table_attribs}} +|align=center {{table_attribs}} +| align=center {{table_attribs}} |} !! htmlFoo | Foo - |
Foo + | +Foo + | Foo |
<script></script> <script></script> < abc
+!! html/parsoid + !! end !! test @@ -6941,6 +7001,8 @@ parsoid=wt2html,wt2wt,html2html !! test Interlanguage link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[zh:Chinese]] @@ -6969,6 +7031,8 @@ Blah blah blah !! test Double interlanguage link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[es:Spanish]] @@ -6984,17 +7048,23 @@ Blah blah blah !! test Interlanguage link variations +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[ es :Spanish]] [[ ZH :Chinese]] +[[es:Foo_bar]] +[[es:Foo bar]] !! html/phpBlah blah blah
!! html/parsoidBlah blah blah
- - + + + + !! end !! test @@ -7398,6 +7468,8 @@ Failing to transform badly formed HTML into correct XHTML !!end +## FIXME: Is Parsoid's acceptance of self-closing html-tags +## a feature or a bug? See https://phabricator.wikimedia.org/T76962 !! test Handling html with a div self-closing tag !! wikitext @@ -7407,7 +7479,7 @@ Handling html with a div self-closing tag<div title /> <div title/>
@@ -7418,6 +7490,13 @@ Handling html with a div self-closing tag
-
+
@@ -8988,8 +9067,7 @@ Template with complex template as argument
!! test
Template with thumb image (with link in description)
!! wikitext
-{{paramtest|
- param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
+{{paramtest|param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
!! html/php
This is a test template with parameter
This is a test template with parameter
!! end !! article @@ -12092,11 +12172,13 @@ File:Barfoo.jpg #REDIRECT [[File:Barfoo.jpg]] !! endarticle +# FIXME: Parsoid should run this test -- but we'd need to teach the +# mockAPI about the redirected Barfoo.jpg image. !! test Redirected image !! wikitext [[Image:Barfoo.jpg]] -!! html +!! html/php !! end @@ -12106,10 +12188,12 @@ Missing image with uploads disabled !! options wgEnableUploads=0 !! wikitext -[[Image:Foobaz.jpg]] -!! html +[[File:Foobaz.jpg]] +!! html/php +!! html/parsoid + !! end # Parsoid-specific testing for images @@ -12348,7 +12432,12 @@ subpage title=[[Subpage test]] !! end -# TODO: make this PHP-parser compatible! +!! article +Subpage test/1/2/subpage +!! text +blah +!! endarticle + !! test Relative subpage noslash link !! options @@ -12358,8 +12447,12 @@ subpage title=[[Subpage test/1/2/3/4]] [[../../subpage/]] [[../../subpage]] -!! html - +!! html/php +subpage +
+!! html/parsoid + !! end @@ -13696,19 +13789,23 @@ Media link to nonexistent file (bug 1702) !! test Image link to nonexistent file (bug 1850 - good) !! wikitext -[[Image:No such.jpg]] -!! html +[[File:No_such.jpg]] +!! html/php +!! html/parsoid + !! end !! test :Image link to nonexistent file (bug 1850 - bad) !! wikitext [[:Image:No such.jpg]] -!! html +!! html/php +!! html/parsoid + !! end @@ -15067,7 +15164,7 @@ Fuzz testing: image with bogus manual thumbnailFoo bar -#
Bar foo -#
!! test Bad images - bug 16039: text after bad image disappears !! wikitext Foo bar [[File:Bad.jpg]] Bar foo +!! DISABLED/html/php +Foo bar +
Bar foo +
!! html/parsoid !! end @@ -18418,14 +18521,16 @@ percent-encoding and + signs in internal links (Bug 26410) !! wikitext [[User:+%]] [[Page+title%]] [[%+]] [[%+|%20]] [[%+ ]] [[%+r]] -[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] +[[%]] [[+]] [[File:%+abc%39|foo|[[bar]]]] [[%33%45]] [[%33%45+]] -!! html +!! html/phpUser:+% Page+title% %+ %20 %+ %+r % + bar 3E 3E+
+!! html/parsoid +User:+% Page+title% %+ %20 %+ %+r % + 3E 3E+
!! end !! test @@ -18433,13 +18538,15 @@ Special characters in embedded file links (bug 27679) !! wikitext [[File:Contains & ampersand.jpg]] [[File:Does not exist.jpg|Title with & ampersand]] -!! html +!! html/phpFile:Contains & ampersand.jpg Title with & ampersand
+!! html/parsoid + !! end - !! test Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) !! wikitext @@ -19424,6 +19531,22 @@ A foo[1] +
+ +'foo' ''foo'' '''foo''' @@ -20607,9 +20730,10 @@ parsoid=html2wt,wt2wt 'foo' 'foo foo' -'foo'
+'foo' fools' errand fool's errand + !! end !! test @@ -21246,15 +21370,12 @@ parsoid !!test Multi-line image caption generated by templates with/without trailing newlines -!!options -parsoid !! wikitext -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] -!! html - - - +[[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] +[[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] +!! html/parsoid + + !!end !! test @@ -21558,6 +21679,17 @@ parsoid=html2wt !!end +!! test +Don't block XML namespace declaration +!! wikitext +MediaWiki +!! html/php +MediaWiki +
+!! html/parsoid +MediaWiki
+!! end + # ----------------------------------------------------------------- # The following section of tests are primarily to spec requirements # around serialization of new/edited content. @@ -21576,6 +21708,64 @@ parsoid=html2wt !! end +!! test +New wiki links (href variations) +!! options +parsoid=html2wt +!! html +Foo_bar +Foo_bar +Foo_bar +Toxine bactérienne +!! wikitext +[[Foo_bar]] +[[Foo_bar]] +[[Foo_bar]] +[[Toxine bactérienne]] +!! end + +!! test +New wiki links (content string variations) +!! options +parsoid=html2wt +!! html +Foo_bar +Foo bar +./Foo_bar +!! wikitext +[[Foo_bar]] +[[Foo bar]] +[[Foo_bar|./Foo_bar]] +!! end + +!! test +New category links (href variations) +!! options +parsoid=html2wt +!! html + + + +!! wikitext +[[Category:Toxine bactérienne]] +[[Category:Toxine bactérienne]] +[[Category:Toxine bactérienne]] +!! end + +!! test +New interlanguage links (href variations) +!! options +parsoid=html2wt +!! html + + + +!! wikitext +[[es:Toxine bactérienne]] +[[es:Toxine_bactérienne]] +[[es:Toxine_bactérienne]] +!! end + !! test Image: Modifying size of an image (1) !! options @@ -21718,33 +21908,31 @@ parsoid #!! options #parsoid=html2wt #language=ar -#!! input +#!! wikitext #[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] -#!! result +#!! html # #!! end !! test Image: Block level image should have \n before and after -!! options -parsoid !! wikitext 123 [[File:Foobar.jpg|right|thumb|150x150px]] 456 -!! html -123
456
+!! html/parsoid +123
+ +456
!!end !! test Image: New block level image should have \n before and after (existing content) -!! options -parsoid !! wikitext 123 [[File:Foobar.jpg|right|thumb|150x150px]] 456 -!! html +!! html/parsoid123
456
@@ -22050,7 +22238,7 @@ parsoid=html2wt !! wikitext ''A''B -''A'''''B''' +''A''AB
AB
@@ -22201,6 +22389,16 @@ parsoid=html2wt !! end +!! test +T75121: Infer extension name from typeOf if data-mw is not present +!! options +parsoid=html2wt +!! wikitext +