!! end
!! test
@@ -8104,6 +8107,7 @@ Link containing double-single-quotes '' in text embedded in italics (T6598 sanit
!! end
+## FIXME: Title part of filename is interpreted in php
!! test
Link with double quotes in title part (literal) and alternate part (interpreted)
!! wikitext
@@ -8121,7 +8125,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
!! end
!! test
@@ -8167,6 +8171,15 @@ Plain link to URL with link text
!! end
+!! test
+Plain link to URL containing special characters, with link text (see T213950).
+!! wikitext
+[[http://www.example.com/?q=%7Babc%7D Link text]]
+!! html
+
File:Noimage.pnglinkcaption
!! end
!! article
@@ -11961,13 +11974,16 @@ Template:Includes3
!! end
+# FIXME: Parsoid's markup for this is quite ugly.
!! test
and on a page
!! wikitext
Foozarbar
-!! html
+!! html/php+tidy
Foozar
+!! html/parsoid
+
Foozar
!! end
!! test
@@ -13088,6 +13104,14 @@ Templates: Links: 5. Nested templates (only outermost template should be marked)
!!end
+!! test
+File with template filename
+!! wikitext
+[[File:{{echo|Foobar.jpg}}]]
+!! html/parsoid
+
+!! end
+
!!test
Templates: HTML Tag: 1. Generation of HTML attr. key
!! wikitext
@@ -14460,7 +14484,7 @@ Right-aligned image
!! html/php
!! html/parsoid
-
+
!! end
!! test
@@ -14584,7 +14608,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/php
This is a caption
!! html/parsoid
-This is a caption
+This is a caption
!! end
!! test
@@ -14640,8 +14664,8 @@ thumbsize=220
123
456
!! html/parsoid
123456
-
123
456
-123
456
+
123
456
+123
456
!! end
!! test
@@ -14865,6 +14889,19 @@ thumbsize=220
!! html/php
+!! html/parsoid
Title
!! end
@@ -14878,7 +14915,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/php
Title
!! html/parsoid
-Title
+Title
!! end
!! test
@@ -14891,7 +14928,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/php
Title
!! html/parsoid
-Title
+Title
!! end
!! test
@@ -14904,7 +14941,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/php
Title
!! html/parsoid
-Title
+Title
!! end
!! test
@@ -14917,7 +14954,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/php
Title
!! html/parsoid
-Title
+Title
!! end
!! test
@@ -14957,7 +14994,7 @@ Image with wiki markup in implicit alt
!! html/parsoid
-
+
!! end
!! test
@@ -14967,15 +15004,11 @@ Alt image option should handle most kinds of wikitext without barfing
!! html/php
This is the image caption
!! html/parsoid
-This is the image caption
+This is the image caption
!! end
!! test
Ampersand in alt attribute (T206940)
-!! options
-parsoid = {
- "nativeGallery": true
-}
!! wikitext
[[File:Foobar.jpg|alt=&]]
@@ -14994,19 +15027,53 @@ File:Foobar.jpg|alt=&
!! html/parsoid
-
+
-
-
-
+
+
+
!! end
+## FIXME: The inconsistency in the gallery extension on the php side is T49646
+!! test
+Link with encoded pipe in alt option
+!! options
+parsoid={
+ "modes": ["wt2html", "html2html"]
+}
+!! wikitext
+[[File:Foobar.jpg|alt=http://testing.123?4=5|6|caption]]
+
+
+
+File:Foobar.jpg|alt=http://testing.123?4=5|6|caption
+
+!! html/php+tidy
+
+
+
+
+
+
+
+
+
+!! html/parsoid
+
+
+
+
+
caption
+!! end
+
!! test
Italics markup in alt attribute (T206940)
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[File:Foobar.jpg|alt=''x''|caption]]
@@ -15027,19 +15094,20 @@ File:Foobar.jpg|alt=''x''|caption
!! html/parsoid
-
+
-
-
-
-
caption
-
+
+
caption
!! end
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
!! test
Nowiki markup in alt attribute (T206940)
+!! options
+parsoid=html2wt
!! wikitext
[[File:Foobar.jpg|alt=''x''|caption]]
@@ -15060,12 +15128,12 @@ File:Foobar.jpg|alt=''x''|caption
!! html/parsoid
-
+
-
-
-
+
+
+
caption
@@ -15073,10 +15141,6 @@ File:Foobar.jpg|alt=''x''|caption
!! test
Nowiki markup in alt attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
- "nativeGallery": true
-}
!! wikitext
[[File:Foobar.jpg|alt=''x''|caption]]
@@ -15097,19 +15161,23 @@ File:Foobar.jpg|alt=''x''|caption
!! html/parsoid
-
+
-
-
-
+
+
+
caption
!! end
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
!! test
Ampersand in link attribute (T206940)
+!! options
+parsoid=html2wt
!! wikitext
[[File:Foobar.jpg|link=Foo & bar]]
@@ -15141,10 +15209,6 @@ File:Foobar.jpg|link=Foo & bar
!! test
Ampersand in link attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
- "nativeGallery": true
-}
!! wikitext
[[File:Foobar.jpg|link=Foo_&_bar]]
@@ -15176,6 +15240,8 @@ File:Foobar.jpg|link=Foo_&_bar
!! test
Italics markup in link attribute (T206940)
+!! options
+parsoid=wt2html,html2html
!! wikitext
[[Foo''s bar''s]]
@@ -15219,7 +15285,7 @@ File:Foobar.jpg|link=''Main Page''|caption2
!! end
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
!! test
Nowiki markup in link attribute (T206940)
+!! options
+parsoid=html2wt
!! wikitext
[[File:Foobar.jpg|link=Foo''s_bar''s|caption]]
@@ -15266,10 +15336,6 @@ File:Foobar.jpg|link=Foo''s_bar''s|caption
!! test
Nowiki markup in link attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
- "nativeGallery": true
-}
!! wikitext
[[File:Foobar.jpg|link=Foo''s_bar''s|caption]]
@@ -15324,7 +15390,7 @@ File:Foobar.jpg|link=https://example.com?foo¶ms=bar
!! end
!! test
@@ -16029,6 +16095,7 @@ Redirected image
!! end
+## FIXME: Parsoid needs to learn about this flag.
!! test
Missing image with uploads disabled
!! options
@@ -16039,7 +16106,7 @@ wgEnableUploads=0
!! end
!! test
@@ -19275,7 +19342,7 @@ language=sr variant=sr-el
!! html/parsoid
-
+
!! end
!! test
@@ -19777,7 +19844,7 @@ Fuzz testing: image with bogus manual thumbnail
!! html/php
Error creating thumbnail:
!! html/parsoid
-
+File:Foobar.jpg
!! end
# Parsoid will emit the newline literally in wt2wt; see next test case.
@@ -20963,8 +21030,8 @@ File:File:Foobar.jpg
!! end
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
!! test
Gallery (with options, extsrc)
!! options
-parsoid={
- "nativeGallery": false
-}
+parsoid=html2wt
!! wikitext
File:Nonexistent.jpg|caption
@@ -21146,10 +21211,10 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
@@ -21427,10 +21487,6 @@ foobar.jpg
!! test
Gallery override link with wikilink (T36852)
-!! options
-parsoid={
- "nativeGallery": true
-}
!! wikitext
File:Foobar.jpg|alt=galleryalt|link=Wikilink
@@ -21451,10 +21507,6 @@ File:Foobar.jpg|alt=galleryalt|link=Wikilink
!! test
Gallery override link with absolute external link (T36852)
-!! options
-parsoid={
- "nativeGallery": true
-}
!! wikitext
File:Foobar.jpg|alt=galleryalt|link=http://www.example.org
@@ -21473,10 +21525,13 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org
!! end
+## Putting the caption at the end here runs into T49646 on the php side
+## so reducing the modes this runs in Parsoid
!! test
Gallery override link with absolute external link with LanguageConverter
!! options
language=zh
+parsoid=wt2html,html2html
!! wikitext
File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
@@ -21492,7 +21547,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
!! html/parsoid
-
!! end
-# Note that parsoid uses the invalid link as a caption, PHP does not.
!! test
Gallery with invalid title as link (T45964)
!! options
parsoid={
- "modes": ["wt2html", "html2html"],
- "nativeGallery": true
+ "modes": ["wt2html", "html2html"]
}
!! wikitext
@@ -21543,8 +21595,8 @@ File:Foobar.jpg|link=<
!! html/parsoid
-
-
link=<
+
+
!! end
@@ -21552,8 +21604,7 @@ File:Foobar.jpg|link=<
Serialize gallery without attrs in data-mw
!! options
parsoid={
- "modes": ["html2wt"],
- "nativeGallery": true
+ "modes": ["html2wt"]
}
!! html/parsoid
@@ -21568,10 +21619,6 @@ File:Test.png
!! test
Gallery with class and style attributes
-!! options
-parsoid={
- "nativeGallery": true
-}
!! wikitext
File:Foobar.jpg
@@ -21592,10 +21639,6 @@ File:Foobar.jpg
!! test
Gallery in slideshow mode
-!! options
-parsoid={
- "nativeGallery": true
-}
!! wikitext
File:Foobar.jpg
@@ -21614,12 +21657,31 @@ File:Foobar.jpg
!! end
+!! test
+Gallery in packed mode
+!! wikitext
+
+File:Foobar.jpg
+
+!! html/php
+
+
+
+
+
+
+
+!! html/parsoid
+
+
+
+!! end
+
!! test
Serialize gallery image captions on a line
!! options
parsoid={
- "modes": ["html2wt"],
- "nativeGallery": true
+ "modes": ["html2wt"]
}
!! html/parsoid
!! html/parsoid
-
+
!! end
!! test
@@ -21838,7 +21900,7 @@ None-aligned image
!! html/php
!! html/parsoid
-
+
!! end
!! test
@@ -21885,6 +21947,7 @@ Width-sized image (using px, with preceding whitespace - test regression from r3
!! end
+## FIXME: Parsoid mocking should include the page in the url to catch regressions
!! test
Image with page parameter
!! options
@@ -21895,7 +21958,7 @@ djvu
!! html/parsoid
-
+
!! end
!! test
@@ -23428,10 +23491,11 @@ language=zh variant=zh-cn
Don't break gallery if language converter markup is inside.
!! options
language=zh
+parsoid=wt2html,html2html
!! wikitext
-File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]]|alt=-{R|bat}-
-File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt
+File:Foobar.jpg|alt=-{R|bat}-|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]]
+File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=-{R|param}-}}
!! html/php
!! wikitext
= =foo= =
@@ -26654,7 +26718,7 @@ parsoid=html2wt
[[Foo|x [http://google.com g] x]]
[[Foo|[[Bar]]]]
[[Foo|x [[Bar]] x]]
-[[Foo||Bar]]
+[[Foo||Bar]]
[[Foo|]]bar]]
[[Foo|[[bar]]
[[Foo|x [[ y]]
@@ -28084,6 +28148,7 @@ parsoid=wt2html
!! end
# Parsoid only for T66747
+# (Also core doesn't define {{#if}} in default install)
!! test
Properly encapsulate empty-content transclusions in fosterable positions
!! wikitext
@@ -28421,6 +28486,7 @@ parsoid={
!! test
Image: Modifying alt attribute of an image (T58400)
!! options
+disabled
parsoid={
"modes": ["wt2wt"],
"changes": [
@@ -28478,7 +28544,7 @@ Image: Block level image should have \n before and after
456
!! html/parsoid
123
-
+
456
!! end
@@ -28490,7 +28556,7 @@ Image: New block level image should have \n before and after (existing content)
456
!! html/parsoid
123
-
+
456
!! end
@@ -28572,7 +28638,7 @@ Image: Invalid title as link
!! html/parsoid
-
+
!! end
!! test
@@ -28589,11 +28655,11 @@ Various link types in alt and link options
!! html/parsoid
-
+
-
+
-
+
!! end
!! test
@@ -29923,6 +29989,28 @@ parsoid= {
|}
!! end
+## Don't necessarily expect this to roundtrip, but run serialization to catch crashers
+!! test
+File in link scenarios
+!! options
+parsoid={
+ "modes": ["wt2html","html2wt"],
+ "suppressErrors": true
+}
+!! wikitext
+[http://www.google.com [[File:Foobar.jpg|123]]]
+
+[http://www.google.com [[File:Foobar.jpg|thumb|123]]]
+!! html/php+tidy
+
+!! end
+
!! test
T179544: {{anchorencode:}} output should be always usable in links
!! config
@@ -31530,6 +31633,7 @@ wgFragmentMode=[ 'html5' ]
!! test
Section wrapping for well-nested sections (no leading content)
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31551,23 +31655,43 @@ e
=3=
f
+!! html/php+tidy
+
+
@@ -31725,6 +31913,7 @@ e
!! test
Section wrapping with template-generated sections (bad nesting 1)
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31732,24 +31921,31 @@ parsoid={
a
-{{echo|
+{{echo|1=
=1=
b
}}
c
+!! html/php+tidy
+
+
a
+
+
1
+
b
+
c
+
+
!! html/parsoid
a
-
-
1
-
b
-
+
1
+
b
-
c
-
+
c
+
!! end
# Because of section-wrapping and template-wrapping interactions,
@@ -31759,6 +31955,7 @@ c
!! test
Section wrapping with template-generated sections (bad nesting 2)
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31777,8 +31974,23 @@ d
=3=
e
+!! html/php+tidy
+
+
@@ -31837,6 +32065,7 @@ e
!! test
Section wrapping with uneditable lead section + div wrapping multiple sections
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31859,24 +32088,45 @@ d
==3.1==
e
+!! html/php+tidy
+
!! end
@@ -31884,6 +32134,7 @@ e
!! test
Section wrapping with editable lead section + div overlapping multiple sections
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31908,26 +32159,51 @@ f
==3.1==
g
+!! html/php+tidy
+
!! end
@@ -31935,6 +32211,7 @@ g
!! test
HTML header tags should not be wrapped in section tags
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31948,21 +32225,30 @@ foo
!! end
!! test
Lead section containing only whitespace and comments.
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31974,19 +32260,28 @@ a
=2=
b
+!! html/php+tidy
+
+
!! end
!! test
-Pseudo-sections emitted by templates should have id -2
+Pseudo-sections emitted by templates should have id -2
!! options
+notoc
parsoid={
"wrapSections": true
}
@@ -31997,6 +32292,13 @@ foo
==b==
}}
+!! html/php+tidy
+
foo
+
+
+
a
+
b
+
!! html/parsoid
foo
@@ -32006,6 +32308,118 @@ foo
!! end
+!! test
+T213468: Transcluded sections don't get PHP section numbers
+!! options
+notoc
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+==PHP section=1==
+{{echo|1=
+== This is counted as if it were section 2 ==
+}}
+==PHP section=3==
+!! html/php+tidy
+
+!! end
+
+!! test
+T213468: Corner cases in edit section ID assignment in tokenizer
+!! options
+notoc
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+==PHP section=1==
+{{echo|Not a section|
+== This is counted as if it were section 2 ==
+}}
+==PHP section=3==
+{{echo3|1=
+== This is counted as if it were section 4 ==
+}}
+==PHP section=5==
+{{#tag:p|Not a section|data-ignored=
+== This is counted as if it were section 6 ==
+}}
+==PHP section=7==
+{{echo|1=Not a ==heading==}}
+==PHP section=8==
+[[File:Foobar.jpg|thumb|
+==This is section 9, even though it's in a caption==
+]]
+==PHP section=10==
+!! html/php+tidy
+
+
+!! html/parsoid
+PARSOID HAS A BUG HERE: T215628
+!! end
+
##########################################################################
Tests demonstrating white-space insensitivity in input wikitext
for wikitext headings, wikitext list items, and wikitext table captions,