X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=e2bf9f64fbb649604a92dd619dab0d2f64fee210;hb=85d4e39ff096d05386fd2f333cd6acea66ad6f90;hp=9cea15637fe56b871a6ad609bfcbb4e67c9e08ee;hpb=90892321696451fb444ce2d70b434e91b8a4fc69;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9cea15637f..e2bf9f64fb 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -21,12 +21,15 @@ # language=XXX set content language to XXX for this test # variant=XXX set the variant of language for this test (eg zh-tw) # disabled do not run test -# parsoid parsoid-only test (not run by PHP parser) -# php php-only test (not run by the parsoid parser) +# parsoid parsoid-specific options (not run by PHP parser unless +# the test includes an html/php section) +# php php-only test (not run by the parsoid parser unless +# the test includes an html/parsoid section) # showtitle make the first line the title # comment run through Linker::formatComment() instead of main parser # local format section links in edit comment text as local links # notoc disable table of contents +# thumbsize=NNN set the default thumb size to NNNpx for this test # # You can also set the following parser properties via test options: # wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, @@ -519,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 @@ -550,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 @@ -577,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 @@ -598,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 @@ -605,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 @@ -625,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 @@ -646,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 @@ -654,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 @@ -696,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 @@ -737,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 @@ -751,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 ### @@ -776,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 @@ -1195,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 ### @@ -1896,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 #-------------------------------------------------------------------- @@ -5509,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 @@ -5679,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 @@ -9662,7 +9966,7 @@ Special:Foobar_nonexistent ### Images ### ### For Parsoid-specific tests, see -#### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images +#### https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images !! test Simple image @@ -9747,13 +10051,15 @@ Image with caption, bug 53312 #3 !! test Allow empty links in image captions (Bug 60753) +!! options +thumbsize=220 !! wikitext [[File:Foobar.jpg|thumb|Caption [[Link1]] [[]] [[Link2]] ]] !! html/php -
Caption Link1 [[]] Link2
+
Caption Link1 [[]] Link2
!! html/parsoid
Caption Link1 @@ -9832,6 +10138,8 @@ Image with multiple attributes from the same template !! test Image with link tails +!! options +thumbsize=220 !! wikitext 123[[File:Foobar.jpg]]456 123[[File:Foobar.jpg|right]]456 @@ -9840,7 +10148,7 @@ Image with link tails

123Foobar.jpg456

123
Foobar.jpg
456 -123
Foobar.jpg
456 +123
Foobar.jpg
456 !! html/parsoid

123456

@@ -9872,12 +10180,14 @@ Image with multiple widths -- use last !! test Image with multiple alignments -- use first (bug 48664) +!! options +thumbsize=220 !! wikitext [[File:Foobar.jpg|thumb|left|right|center|caption]] [[File:Foobar.jpg|middle|text-top|caption]] !! html/php -
caption
+
caption

caption

!! html/parsoid @@ -10033,11 +10343,12 @@ Image with link parameter (URL target) and unnamed parameter !! test Thumbnail image with link parameter !! options +thumbsize=220 parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|thumb|link=http://example.com/|Title]] !! html/php -
Title
+
Title
!! html/parsoid
Title
@@ -10045,57 +10356,71 @@ parsoid=wt2html,wt2wt,html2html !! test Manually-specified thumbnail image +!! options +thumbsize=220 !! wikitext -[[Image:Foobar.jpg|thumb=Thumb.png|Title]] +[[File:Foobar.jpg|thumb=Thumb.png|Title]] !! html/php
Title
!! html/parsoid -XXX NOT IMPLEMENTED XXX +
Title
!! end !! test Manually-specified thumbnail image with explicit link to wiki page +!! options +thumbsize=220 +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|Title]] +[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|Title]] !! html/php
Title
!! html/parsoid -XXX NOT IMPLEMENTED XXX +
Title
!! end !! test Manually-specified thumbnail image with explicit link to url +!! options +thumbsize=220 +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]] +[[File:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]] !! html/php
Title
!! html/parsoid -XXX NOT IMPLEMENTED XXX +
Title
!! end !! test Manually-specified thumbnail image with explicit no link +!! options +thumbsize=220 +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|thumb=Thumb.png|link=|Title]] +[[File:Foobar.jpg|thumb=Thumb.png|link=|Title]] !! html/php
Title
!! html/parsoid -XXX NOT IMPLEMENTED XXX +
Title
!! end !! test Manually-specified thumbnail image with explicit link and alt text +!! options +thumbsize=220 +parsoid=wt2html,wt2wt,html2html !! wikitext -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|alt=alttext|Title]] +[[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|alt=alttext|Title]] !! html/php
alttext
Title
!! html/parsoid -XXX NOT IMPLEMENTED XXX +
alttext
Title
!! end !! test @@ -10141,14 +10466,60 @@ parsoid=wt2html,wt2wt,html2html

testing bold in alt

!! end +################### +# Conflicting image format options. +# First option specified should 'win'. +# All three cases in each test should be identical. + +!! test +Image with 'frameless' first. +!! wikitext +[[File:Foobar.jpg|frameless|caption]] + +[[File:Foobar.jpg|frameless|frame|caption]] + +[[File:Foobar.jpg|frameless|thumb|caption]] +!! html/php +

caption +

caption +

caption +

+!! end + +!! test +Image with 'frame' first. +!! wikitext +[[File:Foobar.jpg|frame|caption]] +[[File:Foobar.jpg|frame|frameless|caption]] +[[File:Foobar.jpg|frame|thumb|caption]] +!! html/php +
caption
+
caption
+
caption
+ +!! end + +!! test +Image with 'thumb' first. +!! wikitext +[[File:Foobar.jpg|thumb|caption]] +[[File:Foobar.jpg|thumb|frameless|caption]] +[[File:Foobar.jpg|thumb|frame|caption]] +!! html/php +
caption
+
caption
+
caption
+ +!! end + ################### # Image sizing. # See https://www.mediawiki.org/wiki/Help:Images#Size_and_frame # and https://bugzilla.wikimedia.org/show_bug.cgi?id=62258 # Foobar has actual size of 1941x220 -# 1. Thumbs & frameless always reduce, can't be enlarged -# 2. Framed images ignore width; always render at default size. -# If given a height, they respect height but continue to ignore width. +# 1. Thumbs & frameless always reduce, can't be enlarged unless it's +# a scalable format. +# 2. Framed images always ignore size options; always render at default size. # 3. "Unspecified format" and border are the only types which can be # enlarged. @@ -10200,16 +10571,20 @@ parsoid=wt2html,wt2wt,html2html !! end !! test -Image: thumbs can't be enlarged past original size +Image: bitmap thumbs can't be enlarged past original size, but vector can. !! options parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|thumb|2000px]] + +[[File:Foobar.svg|thumb|2000px]] !! html/php
Foobar.jpg
+
Foobar.svg
!! html/parsoid
+
!! end !! test @@ -10226,20 +10601,24 @@ parsoid=wt2html,wt2wt,html2html !! end !! test -Image: frameless can't be enlarged past original size +Image: bitmap frameless can't be enlarged past original size, but vector can !! options parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frameless|2000px]] + +[[File:Foobar.svg|frameless|2000px]] !! html/php

Foobar.jpg +

Foobar.svg

!! html/parsoid

+

!! end !! test -Image: framed images ignore size if only width is given +Image: framed images are always unscaled. !! options parsoid=wt2html,wt2wt,html2html !! wikitext @@ -10247,25 +10626,17 @@ parsoid=wt2html,wt2wt,html2html [[File:Foobar.jpg|frame|50px]] +[[File:Foobar.jpg|frame|50x50px]] + [[File:Foobar.jpg|frame|2000px]] !! html/php
Foobar.jpg
Foobar.jpg
Foobar.jpg
+
Foobar.jpg
!! html/parsoid -
-!! end - -!! test -Image: framed images respect size if given a height, but ignore width. -!! wikitext -[[File:Foobar.jpg|frame|50x50px]] -!! html/php -
Foobar.jpg
- -!! html/parsoid -
+
!! end ################### @@ -10303,10 +10674,12 @@ Frameless image caption with a free URL !! test Thumbnail image caption with a free URL +!! options +thumbsize=220 !! wikitext [[File:Foobar.jpg|thumb|http://example.com]] !! html/php - + !! html/parsoid
http://example.com
@@ -10315,11 +10688,12 @@ Thumbnail image caption with a free URL !! test Thumbnail image caption with a free URL and explicit alt !! options +thumbsize=220 parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|thumb|http://example.com|alt=Alteration]] !! html/php - + !! html/parsoid
Alteration
http://example.com
@@ -10330,153 +10704,191 @@ SVG thumbnails with no language set !! options !! wikitext [[File:Foobar.svg|thumb|caption]] -!! html -
caption
+!! html/php +
caption
+!! html/parsoid +
caption
!! end !! test SVG thumbnails with language de !! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.svg|thumb|caption|lang=de]] -!! html -
caption
+!! html/php +
caption
+!! html/parsoid +
caption
!! end !! test SVG thumbnails with invalid language code !! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.svg|thumb|caption|lang=invalid.language.code]] -!! html -
lang=invalid.language.code
+!! html/php +
lang=invalid.language.code
+!! html/parsoid +
lang=invalid.language.code
!! end !! test BUG 1887: A ISBN with a thumbnail !! wikitext -[[Image:foobar.jpg|thumb|ISBN 1235467890]] -!! html +[[File:Foobar.jpg|thumb|ISBN 1235467890]] +!! html/php +!! html/parsoid +
ISBN 1235467890
!! end !! test BUG 1887: A RFC with a thumbnail !! wikitext -[[Image:foobar.jpg|thumb|This is RFC 12354]] -!! html +[[File:Foobar.jpg|thumb|This is RFC 12354]] +!! html/php
This is RFC 12354
+!! html/parsoid +
This is RFC 12354
!! end !! test BUG 1887: A mailto link with a thumbnail !! wikitext -[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] -!! html +[[File:Foobar.jpg|thumb|Please mailto:nobody@example.com]] +!! html/php +!! html/parsoid +
Please mailto:nobody@example.com
!! end # Pending resolution to bug 368 !! test BUG 648: Frameless image caption with a link !! wikitext -[[Image:foobar.jpg|text with a [[link]] in it]] -!! html +[[File:Foobar.jpg|text with a [[link]] in it]] +!! html/php

text with a link in it

+!! html/parsoid +

!! end !! test BUG 648: Frameless image caption with a link (suffix) !! wikitext -[[Image:foobar.jpg|text with a [[link]]foo in it]] -!! html +[[File:Foobar.jpg|text with a [[link]]foo in it]] +!! html/php

text with a linkfoo in it

+!! html/parsoid +

!! end !! test BUG 648: Frameless image caption with an interwiki link !! wikitext -[[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] -!! html +[[File:Foobar.jpg|text with a [[MeatBall:Link]] in it]] +!! html/php

text with a MeatBall:Link in it

+!! html/parsoid +

!! end !! test BUG 648: Frameless image caption with a piped interwiki link !! wikitext -[[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] -!! html +[[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]] +!! html/php

text with a link in it

+!! html/parsoid +

!! end !! test Escape HTML special chars in image alt text !! wikitext -[[Image:foobar.jpg|& < > "]] -!! html +[[File:Foobar.jpg|& < > "]] +!! html/php

& < > "

+!! html/parsoid +

!! end !! test BUG 499: Alt text should have Ӓ, not &1234; !! wikitext -[[Image:foobar.jpg|♀]] -!! html +[[File:Foobar.jpg|♀]] +!! html/php

♀

+!! html/parsoid +

!! end !! test Broken image caption with link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link. -!! html +!! html/php

[[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link.

+!! html/parsoid +

[[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link.

!! end !! test Image caption containing another image !! wikitext -[[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] -!! html -
This is a caption with another image inside it!
+[[File:Foobar.jpg|thumb|This is a caption with another [[File:Thumb.png|image]] inside it!]] +!! html/php +
This is a caption with another image inside it!
+!! html/parsoid +
This is a caption with another inside it!
!! end !! test -Image caption containing a newline +Image: caption containing a newline !! wikitext -[[Image:Foobar.jpg|This +[[File:Foobar.jpg|This *is some text]] -!! html +!! html/php

This *is some text

+!! html/parsoid +

!!end !!test -Parsoid: Image caption containing leading space +Image: caption containing leading space (The leading space should not trigger nowiki escaping in wt2wt mode) !! wikitext -[[Image:Foobar.jpg|thumb| bar]] -!! html +[[File:Foobar.jpg|thumb| bar]] +!! html/php
bar
+!! html/parsoid +
bar
!!end !! test -Images: caption containing a table +Image: caption containing a table +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table {| @@ -10539,12 +10951,13 @@ language=es !! test Localized image handling (2). !! options +thumbsize=220 parsoid=wt2html,wt2wt,html2html language=es !! wikitext [[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]] !! html/php -
caption
+
caption
!! html/parsoid
caption
@@ -10553,11 +10966,12 @@ language=es !! test "border", "frameless" and "class" attributes on an image. !! options +thumbsize=220 parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frameless|border|class=extra|caption]] !! html/php -

caption +

caption

!! html/parsoid

@@ -10567,6 +10981,7 @@ parsoid=wt2html,wt2wt,html2html !! test Invalid image attributes (bug 62500) !! options +thumbsize=220 parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|thumb|float|left|caption]] @@ -10575,9 +10990,9 @@ parsoid=wt2html,wt2wt,html2html [[File:Foobar.jpg|bogus1|thumb|bogus2|left|bogus3|caption]] !! html/php -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! html/parsoid
caption
caption
caption
@@ -10610,7 +11025,7 @@ wgEnableUploads=0 !! end # Parsoid-specific testing for images -# http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images +# https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images # Currently imperfect due to a flaw in the Parsoid testrunner # Work in progress # THESE TESTS SHOULD BE MOVED UP and merged with the php-specific @@ -10732,48 +11147,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 @@ -10816,13 +11219,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 @@ -10890,22 +11313,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 @@ -11647,6 +12126,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 @@ -13278,9 +13774,11 @@ http://example.com
junk
Fuzz testing: image with bogus manual thumbnail !! wikitext [[Image:foobar.jpg|thumbnail= ]] -!! html +!! html/php
Error creating thumbnail:
+!! html/parsoid + !!end !! test @@ -14303,6 +14801,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 @@ -14310,6 +14810,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 @@ -14680,6 +15207,14 @@ ISBN 3-462-04561-X

!! end +!! test +ISBN with empty prefix (parsoid test) +!! wikitext +ISBN 1234567890 +!! html/parsoid +

ISBN 1234567890

+!! end + !! test Bug 22905: followed by ISBN followed by !! wikitext @@ -19061,6 +19596,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 @@ -19087,7 +19639,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 @@ -19301,6 +19853,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 @@ -19341,62 +19904,128 @@ parsoid=html2wt !! test Image: Modifying size of an image (1) !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["img[height]", "attr", "height", "22"], + ["img[width]", "attr", "width", "200"] + ] +} !! wikitext +[[Image:Foobar.jpg|230x230px]] +!! wikitext/edited [[Image:Foobar.jpg|200x200px]] -!! html -

!!end !! test Image: Modifying size of an image (2) !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["img[height]", "attr", "height", "100"], + ["img[width]", "attr", "width", "500"] + ] +} !! wikitext +[[Image:Foobar.jpg|230x230px]] +!! wikitext/edited [[Image:Foobar.jpg|500x500px]] -!! html -

!!end -# note that the data-parsoid value conflicts with the figure's class +# Change in size is ignored so long as class='mw-default-size' +!! test +Image: Modifying size of an image (3) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["figure[class]", "removeClass", "mw-default-size"], + ["figure img", "attr", "height", "19"], + ["figure img", "attr", "width", "170"] + ] +} +!! wikitext +[[Image:Foobar.jpg|thumb]] +!! wikitext/edited +[[Image:Foobar.jpg|thumb|170x170px]] +!!end + !! test Image: Modifying alignment of an image (bug 48665) !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["figure[class]", "removeClass", "mw-halign-right"], + ["figure[class]", "addClass", "mw-halign-left"] + ] +} !! wikitext +[[Image:Foobar.jpg|thumb|caption|right]] +!! wikitext/edited [[Image:Foobar.jpg|thumb|caption|left]] -!! html -
caption
+!! end + +!! test +Image: Modifying mw-default-size of an frameless image (bug 62805) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["figure.mw-default-size", "removeClass", "mw-default-size"] + ] +} +!! wikitext +[[Image:Foobar.jpg|frameless|right]] +!! wikitext/edited +[[Image:Foobar.jpg|frameless|right|220x220px]] !! end !! test Image: Modifying valign of an image (bug 49221) !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["*[typeof=\"mw:Image\"]", "removeClass", "mw-valign-middle"], + ["*[typeof=\"mw:Image\"]", "addClass", "mw-valign-text-top"] + ] +} !! wikitext +[[File:Foobar.jpg|20px|middle]] +!! wikitext/edited [[File:Foobar.jpg|20px|text-top]] -!! html -

!! end !! test Image: Modifying alt attribute of an image (bug 56400) !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["img[alt]", "attr", "alt", "some alternate edited text"] + ] +} !! wikitext +[[File:Foobar.jpg|thumb|some caption|alt=some alternate text]] +!! wikitext/edited [[File:Foobar.jpg|thumb|some caption|alt=some alternate edited text]] -!! html -
some alternate edited text
some caption
!!end !! test Image: Modifying caption of an image !! options -parsoid=html2wt +parsoid={ + "modes": ["wt2wt"], + "changes": [ + ["figcaption", "text", "new caption"] + ] +} !! wikitext +[[Image:Foobar.jpg|thumb|original caption]] +!! wikitext/edited [[Image:Foobar.jpg|thumb|new caption]] -!! html -
new caption
!!end !! test @@ -19448,7 +20077,7 @@ parsoid !!end !! test -Images: upright option (parsoid) +Image: upright option (parsoid) !! options parsoid !! wikitext @@ -19460,7 +20089,7 @@ parsoid !!end !! test -Images: upright option is ignored on inline and frame images (parsoid) +Image: upright option is ignored on inline and frame images (parsoid) !! options parsoid !! wikitext @@ -19469,6 +20098,48 @@ parsoid

!!end +!! test +Image: from basic HTML (1) +!! options +parsoid=html2wt +!! html/parsoid + + Alt + +!! wikitext +[[File:Foobar.jpg|link=|alt=Alt|100x100px]] +!! end + +!! test +Image: from basic HTML (2) +!! options +parsoid=html2wt +!! html/parsoid +Alt +!! wikitext +[[File:Foobar.jpg|link=|alt=Alt|100x100px]] +!! end + +!! test +Image: from basic HTML (3) +!! options +parsoid=html2wt +!! html/parsoid +Alt +!! wikitext +[[File:Foobar.jpg|link=Main|alt=Alt|100x100px]] +!! end + +!! test +Image: from basic HTML (4) +!! options +parsoid=html2wt +!! html/parsoid + +!! wikitext +[[File:Foobar.jpg|link=]] +!! end + !! test Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) !! options