!! end
!! test
@@ -1855,6 +1868,19 @@ parsoid=wt2html,wt2wt
!! end
+## Make sure ">" gets escaped in comments to avoid XSS
+!! test
+IE conditional comments
+!! wikitext
+
+!! html/parsoid
+
+!! end
+
###
### paragraph wrapping tests
###
@@ -1886,6 +1912,33 @@ a
foo
b
!! end
+!! test
+No p-wrappable content
+!! wikitext
+
x
+
x
+
x
+!! html+tidy
+
x
+
x
+
x
+!! html/parsoid
+
x
+
x
+
x
+!! end
+
+# T177612: Parsoid-only test
+!! test
+Transclusion meta tags shouldn't trip Parsoid's useless p-wrapper stripping code
+!! wikitext
+{{echo|
x
}}
+x
+!! html/parsoid
+
x
+
x
+!! end
+
!! test
Block tag on one line (
)
!! wikitext
@@ -2423,7 +2476,7 @@ Block tag pre
foo
!! html/parsoid
-
foo
+
foo
!! end
!!test
@@ -2818,7 +2871,7 @@ Templates: Handle comments in the target
foo
foo
-!!end
+!! end
!! test
Templates: Handle comments in parameter names (T69657)
@@ -2848,7 +2901,7 @@ Templates: Handle comments in parameter names (T69657)
foo
foo
-!!end
+!! end
!! test
Templates: Other wikitext in parameter names (T69657)
@@ -2859,11 +2912,23 @@ Templates: Other wikitext in parameter names (T69657)
!! html/parsoid
{{{1}}}
-!!end
+!! end
+
+!! test
+Templates: With colons
+!! wikitext
+{{With: Colon}}
+!! html/php
+
Template with colon
+
+!! html/parsoid
+
Template with colon
+!! end
#--------------------------------------------------------------------
# Transclusion parameter escaping tests
#--------------------------------------------------------------------
+
!! test
Templates: Parsoid parameter escaping test 1
!! wikitext
@@ -4294,6 +4359,21 @@ Definition Lists: Mixed Lists: Test 10
!! end
+# This is a regression test for T175099
+# html/php+tidy is insufficient since Tidy covers up the bug.
+# But once Tidy is replaced with RemexHTML, html/php+tidy is good enough
+!! test
+Definition Lists: Mixed Lists: Test 11
+!! wikitext
+; a
+:* b
+!! html/*
+
a
+
+
b
+
+!! end
+
# The Parsoid team disagrees with the PHP parser's seemingly-random
# rules regarding dd/dt on the next two tests. Parsoid is more
# consistent, and recognizes the shared nesting and keeps the
@@ -4301,7 +4381,7 @@ Definition Lists: Mixed Lists: Test 10
# (And tidy again converts
to
before 'bar'.)
!! test
-Definition Lists: Mixed Lists: Test 11
+Definition Lists: Mixed Lists: Test 12
!! wikitext
*#*#;*;;foo :bar
*#*#;boo :baz
@@ -4753,8 +4833,11 @@ foo//example.com/Foo
!! end
+## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
!! test
External links: with no contents
+!! options
+parsoid=wt2html,wt2wt
!! wikitext
[http://en.wikipedia.org/wiki/Foo]
@@ -4858,7 +4941,7 @@ External links: Free with trailing quotes (T113666)
news:'a'b''c''d e
!! html/php
!! end
## We don't support roundtripping of these attributes in Parsoid.
@@ -6809,7 +6892,7 @@ T107652: s in templates that also generate table cell attributes should be
!! end
!! test
@@ -7269,8 +7352,8 @@ parsoid=wt2html
!! html
-
-
+
+
!! end
@@ -7719,13 +7802,16 @@ Piped link with extlink-like text
!! wikitext
[[Main Page|[bar]]]
[[Main Page|This is a [bar]]]
+[[Main Page|[bar]]
!! html/php
+This is a [bar]
+[bar
!! end
!! test
@@ -7917,7 +8003,7 @@ Link containing double-single-quotes '' (T6598)
!! wikitext
[[Lista d''e paise d''o munno]]
!! html/php
-
@@ -8065,7 +8151,6 @@ Plain link to page with question mark in title
!! end
-
# I'm fairly sure the expected result here is wrong.
# We want these to be URL links, not pseudo-pages with URLs for titles....
# However the current output is also pretty screwy.
@@ -8088,6 +8173,34 @@ Piped link to URL: [[http://www.example.com|an example URL]]
+!! end
+
!! test
T2002: [[page|http://url/]] should link to page, not http://url/
!! wikitext
@@ -8172,6 +8285,33 @@ Non-breaking spaces in title
!!end
+# Add new article for the test below so that it doesn't red-link
+!! article
+Foo bar baz
+!! text
+boo
+!! endarticle
+
+!! test
+Multiple spaces in titles should normalize to a single underscore
+!! options
+parsoid=wt2html,wt2wt
+!! wikitext
+[[Foo bar baz|x]]
+[[Foo bar baz|x]]
+[[Foo bar baz|x]]
+!! html/php
+
+!! end
+
!! test
Internal link with ca linktrail, surrounded by bold apostrophes (T29473 primary issue)
!! options
@@ -8223,7 +8363,7 @@ language=kaa
!! wikitext
[[Something]]'nice
!! html
-
!! end
+## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
!! test
Interwiki link encoding conversion (T3636)
+!! options
+parsoid=wt2html,wt2wt
!! wikitext
*[[Wikipedia:ro:Olteniţa]]
*[[Wikipedia:ro:Olteniţa]]
@@ -8488,6 +8656,11 @@ Interwiki link encoding conversion (T3636)
+!! end
+
## parsoid html2wt will normalize the space to _
!! test
Space and question mark encoding in interlanguage links (T95473)
@@ -9142,8 +9334,6 @@ some text
!! end
-# FIXME: Should hoist the redirect to the top of the page and ensure there
-# is only one.
!! test
New redirect
!! options
@@ -9151,7 +9341,53 @@ parsoid=html2wt
!! html/parsoid
Foo
!! wikitext
+#REDIRECT [[Foo]]
Foo
+!! end
+
+!! test
+Redirect followed by block on the same line
+!! options
+parsoid=wt2html
+!! wikitext
+#REDIRECT [[Main Page]]== hi ==
+!! html/parsoid
+
hi
+!! end
+
+!! test
+Redirect followed by a newline
+!! wikitext
+#REDIRECT [[Main Page]]
+A newline
+!! html/parsoid
+
+
A newline
+!! end
+
+!! test
+Redirect followed by multiple newlines
+!! wikitext
+#REDIRECT [[Main Page]]
+
+
+A newline
+!! html/parsoid
+
+
+
+A newline
+!! end
+
+!! test
+Drop duplicate redirects
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+
+
+!! wikitext
#REDIRECT [[Foo]]
!! end
@@ -9238,7 +9474,7 @@ Handling html with a div self-closing tag
!! html/parsoid
-
+
@@ -9533,7 +9769,7 @@ parsoid
!! wikitext
*
!! html/parsoid
-
+
!! end
!! test
@@ -9703,6 +9939,17 @@ parsoid=wt2html,wt2wt
not a li-hack
+!! html/parsoid
+
foo
+
li-hack
+
templated li-hack
+
unsupported li-hack with preceding comments
+
+
+
not a li-hack
+
+
+
!!end
!! test
@@ -9738,9 +9985,9 @@ Parsoid: Test of whitespace serialization with Templated bullets
parsoid
!! wikitext
* {{bullet}}
-!! html
+!! html/parsoid
+flags=vary-revision-id
!! end
!! test
@@ -11138,6 +11387,15 @@ Templates with templated name
item 1
!! end
+## Regression test; the output here isn't really that interesting.
+!! test
+Templates with templated name and top level template args
+!! wikitext
+{{1{{2{{{3}}}|4=5}}}}
+!! html/parsoid
+
{{1{{2{{{3}}}|4=5}}}}
+!! end
+
# Parsoid markup is deliberate "broken". This is an edge case.
# See long comment in TemplateHandler.js:convertAttribsToString.
!! test
@@ -11877,6 +12135,8 @@ parsoid
##{{[[-{{{{{{[[Foo|bar}}]]}-}}}}}]]
!! test
Preprocessor precedence 1: link is rightmost opening
+!! options
+parsoid=wt2html
!! wikitext
{{[[Foo|bar}}]]
@@ -11885,13 +12145,17 @@ But close-brace is not a valid character in a link title:
However, we can still tell this was handled as a link in the preprocessor:
{{echo|[[Foo}}|bar]]|bat}}
-!! html
+!! html/php
But close-brace is not a valid character in a link title: {{[[Foo}}|bar]]
+
However, we can still tell this was handled as a link in the preprocessor: [[Foo}}|bar]]
!! end
!! test
@@ -11900,26 +12164,33 @@ Preprocessor precedence 2: template is rightmost opening
language=zh
!! wikitext
-{{echo|foo}-}}-
-!! html
+!! html/php
-foo}--
+!! html/parsoid
+
-foo}--
!! end
!! test
Preprocessor precedence 3: language converter is rightmost opening
!! options
language=zh
+parsoid=wt2html
!! wikitext
{{echo|hi}}
{{-{R|echo|hi}}}-
[[-{R|raw]]}-
-!! html
+!! html/php
hi
{{echo|hi}}
[[raw]]
+!! html/parsoid
+
hi
+
{{
+
[[
!! end
!! test
@@ -11928,7 +12199,9 @@ Preprocessor precedence 4: left-most angle bracket
language=zh
!! wikitext
-!! html
+!! html/php
+!! html/parsoid
+
!! end
!! article
@@ -11941,21 +12214,28 @@ Template:Precedence5
Preprocessor precedence 5: tplarg takes precedence over template
!! wikitext
{{Precedence5|Bullet}}
-!! html
+!! html/php
Bar
+!! html/parsoid
+
Bar
!! end
!! test
Preprocessor precedence 6: broken link is rightmost opening
+!! options
+parsoid=wt2html
!! wikitext
{{echo|[[Foo}}
{{echo|[[Foo|bar|bat=baz}}
-!! html
+!! html/php
{{echo|[[Foo}}
{{echo|[[Foo|bar|bat=baz}}
+!! html/parsoid
+
{{echo|[[Foo}}
+
{{echo|[[Foo|bar|bat=baz}}
!! end
# This next test exposes a difference between PHP and Parsoid:
@@ -11980,6 +12260,8 @@ Preprocessor precedence 6: broken link is rightmost opening
!! test
Preprocessor precedence 7: broken template is rightmost opening
+!! options
+parsoid=wt2html
!! wikitext
[[Foo|{{echo|Bar]]
@@ -11987,12 +12269,17 @@ Preprocessor precedence 7: broken template is rightmost opening
Careful: linktrails can move the end of the wikilink:
[[Foo|{{echo|y']]a}}l]]l
-!! html
+!! html/php
Careful: linktrails can move the end of the wikilink:
+y']]all
!! end
!! test
@@ -12019,7 +12306,7 @@ Template:Preprocessor_precedence_9
Preprocessor precedence 9: groups of braces
!! wikitext
{{Preprocessor precedence 9|Four|Bullet|1|2}}
-!! html
+!! html/php
4
{Four}
5
@@ -12030,6 +12317,20 @@ Preprocessor precedence 9: groups of braces
7
{Bullet}
+!! html/parsoid
+
+
4
+
{Four}
+
5
+
+
+
Bar
+
+
6
+
Four
+
7
+
{Bullet}
+
!! end
!! article
@@ -12050,7 +12351,7 @@ Preprocessor precedence 10: groups of braces with leading dash
language=zh
!! wikitext
{{Preprocessor precedence 10|Three|raw2|Bullet|1|2}}
-!! html
+!! html/php
1
raw
2
@@ -12068,6 +12369,29 @@ language=zh
7
raw2
+!! html/parsoid
+
+
1
+
+
2
+
-
+
+
Bar-
+
+
3
+
-Three-
+
4
+
+
5
+
-
+
+
Bar-
+
+
6
+
-Three-
+
7
+
+
!! end
!! test
@@ -12078,15 +12402,23 @@ Preprocessor precedence 11: found during visual diff testing
{{echo|-{{echo|-{{echo|x}}}}}}
{{echo|-{{echo|x}}}}
-!! html
+!! html/php
--x
--x
-x
+!! html/parsoid
+
--x
+
+
--x
+
+
-x
!! end
!! test
Preprocessor precedence 12: broken language converter closed by brace.
+!! options
+parsoid=wt2html
!! wikitext
This form breaks the template, which is unfortunate:
* {{echo|foo-{bar}bat}}
@@ -12101,7 +12433,7 @@ tag, nothing bad happens:
foo-{bar}bat
{{echo|foo-{bar}bat}}
-!! html+tidy
+!! html/php+tidy
This form breaks the template, which is unfortunate:
This form breaks the template, which is unfortunate:
+
+
{{echo|foo-{bar}bat}}
+
+
But if the broken language converter markup is inside an extension tag, nothing bad happens:
+
+
foo-{bar}bat
+
foo-{bar}bat
+
foo-{bar}bat
+
foo-{bar}bat
+
+
!! end
!! test
-Preprocessor precedence, 13: broken language converter in external link
+Preprocessor precedence 13: broken language converter in external link
+!! options
+parsoid=wt2html
!! wikitext
* [http://example.com/-{foo Example in URL]
* [http://example.com Example in -{link} description]
* {{echo|[http://example.com/-{foo Breaks template, however]}}
-!! html+tidy
+!! html/php+tidy
!! end
!! test
-Preprocessor precedence, 14: broken language converter in comment
+Preprocessor precedence 14: broken language converter in comment
!! wikitext
* ...should be ok
* ...extra dashes
* {{echo|foobat}} ...should be ok
-!! html+tidy
+!! html/php+tidy
...should be ok
...extra dashes
foobat ...should be ok
+!! html/parsoid
+
+
...should be ok
+
...extra dashes
+
foobat ...should be ok
+
!! end
!! test
-Preprocessor precedence, 15: broken brace markup in headings
+Preprocessor precedence 15: broken brace markup in headings
+!! options
+parsoid=wt2html
!! wikitext
__NOTOC__ __NOEDITSECTION__
===1 foo[bar 1===
@@ -12175,7 +12536,7 @@ __NOTOC__ __NOEDITSECTION__
5
===6 foo-{bar 6===
6
-!! html+tidy
+!! html/php+tidy
1 foo[bar 1
1
2 foo[[bar 2
@@ -12188,6 +12549,35 @@ __NOTOC__ __NOEDITSECTION__
5
6 foo-{bar 6
6
+!! html/parsoid
+
+
1 foo[bar 1
+
1
+
2 foo[[bar 2
+
2
+
3 foo{bar 3
+
3
+
4 foo{{bar 4
+
4
+
5 foo{{{bar 5
+
5
+
6 foo-{bar 6
+
6
+!! end
+
+!! test
+Preprocessor precedence 16: matching closing braces to opening braces
+!! options
+language=zh
+parsoid=wt2html
+!! wikitext
+-{{{echo|foo}}bar}-
+!! html/php
+
foobar
+
+!! html/parsoid
+
!! end
###
@@ -12914,7 +13304,7 @@ Templates: Wiki Tables: 7. Fosterable s should get fostered
-
!!end
!! test
@@ -13126,8 +13516,16 @@ Templates: Parameters substituted at the top-level
bar
!! end
-!!test
-Parser Functions: 1. Simple example
+!! test
+Templates: Param with empty arg in the final position
+!! wikitext
+{{{hi|}}}
+!! html/parsoid
+
+!! end
+
+!!test
+Parser Functions: 1. Simple example
!! wikitext
{{uc:foo}}
!! html
@@ -13619,17 +14017,34 @@ pre-save transform: Signature expansion
pst
!! wikitext
* ~~~
+* ~~~~
+* ~~~~~
* ~~~
* ~~~
* ~~~
!! html/php
* [[Special:Contributions/127.0.0.1|127.0.0.1]]
+* [[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
+* 00:02, 1 January 1970 (UTC)
* [[Special:Contributions/127.0.0.1|127.0.0.1]]
* [[Special:Contributions/127.0.0.1|127.0.0.1]]
* [[Special:Contributions/127.0.0.1|127.0.0.1]]
!! end
+!! test
+ParserOutput flags from signature expansion (T84843)
+!! options
+pst
+showflags
+!! wikitext
+~~~~
+!! html/php
+[[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
+flags=user-signature
+!! end
+
+
!! test
pre-save transform: Signature expansion in nowiki tags (T2093)
!! options
@@ -13852,6 +14267,16 @@ parsoid=wt2html,wt2wt,html2html
!! end
+!! test
+Serialize simple image with figure-inline wrapper
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! wikitext
+[[File:Foobar.jpg]]
+!! end
+
!! test
Simple image (using File: namespace, now canonical)
!! wikitext
@@ -13918,6 +14343,20 @@ Image with caption, T55312 #3
Caption page=stuff
!! end
+!! test
+Image caption with pipe entity
+!! wikitext
+[[File:Foobar.jpg|thumb|one | two]]
+[[File:Foobar.jpg|thumb|one ''two'' | three]]
+!! html/php
+
one | two
+
one two | three
+
+!! html/parsoid
+one | two
+one two| three
+!! end
+
!! test
Allow empty links in image captions (T62753)
!! options
@@ -14395,6 +14834,28 @@ Alt image option should handle most kinds of wikitext without barfing
This is the image caption
!! end
+!! test
+Image with nested tables in caption
+!! wikitext
+[[File:Foobar.jpg|thumb|Foo
+{|
+|
+{|
+|z
+|}
+|}
+]]
+!! html/parsoid
+
Foo
+
+
+
+
z
+
+
+
+!! end
+
###################
# Conflicting image format options.
# First option specified should 'win'.
@@ -14471,7 +14932,7 @@ parsoid=wt2html,wt2wt,html2html
# enlarged.
!! test
-Image: "unspecified format" and border enlarge
+Image: unspecified format and border enlarge
!! options
parsoid=wt2html,wt2wt,html2html
!! wikitext
@@ -14483,8 +14944,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14530,8 +14991,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14560,8 +15021,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14658,7 +15119,7 @@ SVG thumbnails with no language set
caption
!! html/parsoid
-caption
+caption
!! end
!! test
@@ -14671,7 +15132,7 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid
-caption
+caption
!! end
!! test
@@ -15238,7 +15699,7 @@ T93580: 1. Templated inside block images
!! html/parsoid
Caption with templated ref: [1]
-
!! end
@@ -15775,6 +16236,68 @@ parsoid=wt2html
!! end
+!! test
+9. Categories and newlines: should behave properly with linkprefix (T87753)
+!! options
+language=ar
+!! wikitext
+foo bar
+foo bar
+[[تصÙÙÙ:Foo]]
+[[تصÙÙÙ:Bar]]
+!! html/php
+
foo bar
+foo bar
+
+!! html/parsoid
+
foo bar
+foo bar
+
+
+!! end
+
+!! test
+10. No regressions on internal links following category (T174639)
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+[[Category:Foo]]
+!! end
+
+# Note that Parsoid differs slightly from PHP due to T175421
+!! test
+11. Special case where only newlines separate links (T175416)
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+[[Category:Foo]]
+
+[[Foo]][[es:Alimento]]
+
+[[Foo]]
+!! html/php
+
@@ -16779,6 +17316,24 @@ HTML tag with leading space is parsed as text
!! end
+## Don't expect Parsoid and PHP to match, since PHP isn't exactly following
+## the HTML5 parsing spec.
+!! test
+Element with broken attribute syntax
+!! options
+parsoid=wt2html
+!! wikitext
+
hi
+
ho
+!! html/php
+
hi
+
ho
+
+!! html/parsoid
+
hi
+
ho
+!! end
+
###
### Nesting tests (see T43545, T52604, T53081)
###
@@ -16867,11 +17422,17 @@ Nesting of
Media link
!! wikitext
[[Media:Foobar.jpg]]
+[[Media:Video.ogv]]
+[[:Media:Video.ogv]]
!! html/php
!! end
-
-
!! test
Character reference normalization in link text (T3938)
!! wikitext
@@ -17775,7 +18334,7 @@ Parser hook: static parser hook inside a comment
!! html/parsoid
-
+
!! end
# Nested template calls; this case was broken by Parser.php rev 1.506,
@@ -17807,18 +18366,16 @@ Nested template calls
### Sanitizer
###
-# HTML+Tidy effectively strips out the empty tags completely
-# But since Parsoid doesn't it wraps the tags in p-tags
-# which Tidy would have done for the PHP parser had there been content inside it.
+# HTML+Tidy strips out empty tags completely. Parsoid doesn't.
+# FIXME: Wikitext for this first test doesn't match its title.
!! test
Sanitizer: Closing of open tags
!! wikitext
-!! html
-
+!! html/php+tidy
!! html/parsoid
-
+
!! end
!! test
@@ -17935,12 +18492,17 @@ but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
then we get cut off here: }-
all additional text is vanished
-!! html
+!! html/php
this bit is safe: }-
but if we add a conversion instance: xxx
then we get cut off here: }-
all additional text is vanished
+!! html/parsoid
+
this bit is safe: }-
+
but if we add a conversion instance:
+
then we get cut off here: }-
+
all additional text is vanished
!! end
!! test
@@ -19523,7 +20085,7 @@ parsoid=wt2html
'''''
!! html/php
!! html/parsoid
-
+
!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
@@ -19647,7 +20209,7 @@ File:File:Foobar.jpg
!! html/parsoid
-
File:File:Foobar.jpg
+
!! end
@@ -19710,12 +20272,12 @@ image4 |300px| centre
!! html/parsoid
!! end
-## Should Parsoid be preserving these variations?
+## Should Parsoid be preserving these variations? See T151367
!! test
Gallery (with namespace-less filenames)
!! options
@@ -20047,10 +20609,10 @@ foobar.jpg
!! html/parsoid
-
File:Nonexistent.jpg
-
Nonexistent.jpg
-
-
+
+
+
+
!! end
@@ -20075,7 +20637,7 @@ File:Foobar.jpg|alt=galleryalt|link=InterWikiLink
!! html/parsoid
-
+
!! end
@@ -20100,7 +20662,7 @@ File:Foobar.jpg|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
@@ -20173,7 +20736,7 @@ File:Foobar.jpg|link=<
!! html/parsoid
-
link=<
+
link=<
!! end
@@ -20187,7 +20750,7 @@ parsoid={
!! html/parsoid
!! end
@@ -20555,7 +21118,7 @@ HTML with raw HTML ($wgRawHtml==true)
wgRawHtml=1
!! wikitext
-!! html
+!! html/php
!! end
@@ -20964,16 +21527,22 @@ Parsing of overlapping (improperly nested) inline html tags
###
### Language variants related tests
###
+
+# Parsoid does not mark self-links.
+# Parsoid does not convert links; PHP will do any necessary redirects.
+
!! test
Self-link in language variants
!! options
title=[[Dunav]] language=sr
!! wikitext
Both [[Dunav]] and [[ÐÑнав]] are names for this river.
-!! html
+!! html/php
+!! end
!! article
ÐÑна
@@ -20987,9 +21556,11 @@ Link to another existing title shouldn't be parsed as self-link even if it's a v
title=[[Duna]] language=sr
!! wikitext
[[ÐÑна]] is not a self-link while [[Duna]] and [[DÑна]] are still self-links.
-!! html
+!! html/php
!! end
!! test
@@ -20998,9 +21569,11 @@ Link to a section of a variant of this title shouldn't be parsed as self-link
title=[[Duna]] language=sr
!! wikitext
[[DÑна]] is a self-link while [[Dunа#Foo]] and [[DÑна#Foo]] are not self-links.
-!! html
+!! html/php
!! end
!! test
@@ -21009,10 +21582,12 @@ Link to pages in language variants
language=sr
!! wikitext
Main Page can be written as [[Ðаин Ðаге]]
-!! html
+!! html/php
+!! end
!! test
@@ -21021,10 +21596,12 @@ Multiple links to pages in language variants
language=sr
!! wikitext
[[Main Page]] can be written as [[Ðаин Ðаге]] same as [[Ðаин Ðаге]].
-!! html
+!! html/php
+!! end
!! test
@@ -21033,7 +21610,7 @@ Simple template in language variants
language=sr
!! wikitext
{{ÑеÑÑ}}
-!! html
+!! html/php
This is a test template
!! end
@@ -21045,7 +21622,7 @@ Template with explicit namespace in language variants
language=sr
!! wikitext
{{Template:ÑеÑÑ}}
-!! html
+!! html/php
This is a test template
!! end
@@ -21057,7 +21634,7 @@ Basic test for template parameter in language variants
language=sr
!! wikitext
{{паÑамÑеÑÑ|param=foo}}
-!! html
+!! html/php
This is a test template with parameter foo
!! end
@@ -21111,9 +21688,11 @@ Stripping -{}- tags (language variants)
language=sr
!! wikitext
Latin proverb: -{Ne nuntium necare}-
-!! html
+!! html/php
Latin proverb: Ne nuntium necare
+!! html/parsoid
+
Latin proverb:
!! end
@@ -21123,9 +21702,11 @@ Prevent conversion with -{}- tags (language variants)
language=sr variant=sr-ec
!! wikitext
Latinski: -{Ne nuntium necare}-
-!! html
+!! html/php
ÐаÑинÑки: Ne nuntium necare
+!! html/parsoid
+
Latinski:
!! end
@@ -21135,9 +21716,11 @@ Prevent conversion of text with -{}- tags (language variants)
language=sr variant=sr-ec
!! wikitext
Latinski: -{Ne nuntium necare}-
-!! html
+!! html/php
ÐаÑинÑки: Ne nuntium necare
+!! html/parsoid
+
Latinski:
!! end
@@ -21147,9 +21730,11 @@ Prevent conversion of links with -{}- tags (language variants)
language=sr variant=sr-ec
!! wikitext
-{[[Main Page]]}-
-!! html
+!! html/php
!! end
@@ -21159,11 +21744,26 @@ language=sr variant=sr-ec
language=sr variant=sr-ec
!! wikitext
== -{Naslov}- ==
-!! html
+
+Note that even an unprotected headline ID is not affected by language
+conversion:
+
+== Latinski ==
+!! html/php
Note that even an unprotected headline ID is not affected by language
+conversion:
+
+
Latinski
+!! end
!! test
Explicit definition of language variant alternatives
@@ -21171,130 +21771,362 @@ Explicit definition of language variant alternatives
language=zh variant=zh-tw
!! wikitext
-{zh:China;zh-tw:Taiwan}-, not China
-!! html
+!! html/php
Taiwan, not China
+!! html/parsoid
+
, not China
!! end
+!! test
+Filter syntax for language variants
+!! options
+language=zh variant=zh-tw
+!! wikitext
+foo-{zh;zh-hans;zh-hant|blog, WEBJOURNAL, WEBLOG}-quux
+!! html/php
+
fooblog, WEBJOURNAL, WEBLOGquux
+
+!! html/parsoid
+
fooquux
+!! end
+# Note that Parsoid post-processing for language variants needs to
+# update the `title` attribute here, based on the mw:ExpandedAttrs property
!! test
Conversion around HTML tags
!! options
language=sr variant=sr-ec
!! wikitext
--{H|span=>sr-ec:script;title=>sr-ec:src;}-
-ski
-!! html
+-{H|span=>sr-ec:script;title=>sr-ec:src}-
+ski
+!! html/php
Ñки
+!! html/parsoid
+
+ski
!! end
-
!! test
-Explicit session-wise language variant mapping (A flag and - flag)
+Explicit session-wise two-way language variant mapping (A flag and - flag)
!! options
language=zh variant=zh-tw
!! wikitext
+This is -{zh:China; zh-tw:Taiwan}-, but we'll forget that now.
+
Taiwan is not China.
-But -{A|zh:China;zh-tw:Taiwan}- is China,
-(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
+
+But -{A|zh:China; zh-tw:Taiwan}- is China,
+
+(This-{-|zh:China; zh-tw:Taiwan}- should be stripped!)
+
and -{China}- is China.
-!! html
-
Taiwan is not China.
-But Taiwan is Taiwan,
-(This should be stripped!)
-and China is China.
+!! html/php
+
This is Taiwan, but we'll forget that now.
+
Taiwan is not China.
+
But Taiwan is Taiwan,
+
(This should be stripped!)
+
and China is China.
+!! html/parsoid
+
This is , but we'll forget that now.
+
Taiwan is not China.
+
But is China,
+
(This should be stripped!)
+
and is China.
!! end
!! test
-Explicit session-wise language variant mapping (H flag for hide)
+Explicit session-wise one-way language variant mapping (A flag and - flag)
!! options
language=zh variant=zh-tw
!! wikitext
-(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
-Taiwan is China.
-!! html
-
(This should be stripped!)
-Taiwan is Taiwan.
+This is -{COUNTRY=>zh:China;COUNTRY=>zh-tw:Taiwan}-, but we'll forget that now.
+
+COUNTRY is China or Taiwan.
+
+But -{A|COUNTRY=>zh:China;COUNTRY=>zh-tw:Taiwan}- is COUNTRY,
+
+(This-{-|COUNTRY=>zh:China;COUNTRY=>zh-tw:Taiwan}- should be stripped!)
+
+and -{COUNTRY}- is COUNTRY.
+!! html/php
+
This is Taiwan, but we'll forget that now.
+
COUNTRY is China or Taiwan.
+
But Taiwan is Taiwan,
+
(This should be stripped!)
+
and COUNTRY is COUNTRY.
+!! html/parsoid
+
This is , but we'll forget that now.
+
COUNTRY is China or Taiwan.
+
But is COUNTRY,
+
(This should be stripped!)
+
and is COUNTRY.
!! end
!! test
-Adding explicit conversion rule for title (T flag)
+Explicit session-wise two-way language variant mapping (H flag for hide)
!! options
-language=zh variant=zh-tw showtitle
+language=zh variant=zh-tw
!! wikitext
-Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
-!! html
-Taiwan
-
Should be stripped!
+(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
+
+Taiwan is China.
+!! html/php
+
(This should be stripped!)
+
Taiwan is Taiwan.
+!! html/parsoid
+
(This should be stripped!)
+
Taiwan is China.
!! end
!! test
-Testing that changing the language variant here in the tests actually works
+Explicit session-wise one-way language variant mapping (H flag for hide)
!! options
-language=zh variant=zh showtitle
+language=zh variant=zh-tw
!! wikitext
-Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
-!! html
-China
-
Should be stripped!
+(This-{H|COUNTRY=>zh:China;COUNTRY=>zh-tw:Taiwan}- should be stripped!)
+
+COUNTRY is Taiwan or China.
+!! html/php
+
(This should be stripped!)
+
Taiwan is Taiwan or China.
+!! html/parsoid
+
(This should be stripped!)
+
COUNTRY is Taiwan or China.
!! end
+## Note that parsoid test runner does not support 'showtitle' option.
!! test
-Recursive conversion of alt and title attrs shouldn't clear converter state
+Adding explicit conversion rule for title (T flag)
!! options
-language=zh variant=zh-cn showtitle
+language=zh variant=zh-tw showtitle
!! wikitext
--{H|zh-cn:Exclamation;zh-tw:exclamation;}-
-Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-!
-!! html
-China
-
-Should be stripped!
+Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
+
+Taiwan is China.
+!! html/php
+Taiwan
+
Should be stripped!
+
Taiwan is China.
+!! html/parsoid
+
Should be stripped!
+
Taiwan is China.
!! end
!! test
-T26072: more test on conversion rule for title
+Code coverage: T combined with H flag
!! options
language=zh variant=zh-tw showtitle
!! wikitext
-This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
-This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
-!! html
+Should be stripped-{T;H|zh:China; zh-tw:Taiwan}-!
+
+Taiwan is China.
+!! html/php
Taiwan
-
This should be stripped!
-This won't take interferes with the title rule.
+
Should be stripped!
+
Taiwan is Taiwan.
+!! html/parsoid
+
Should be stripped!
+
Taiwan is China.
!! end
!! test
-Partly disable title conversion if variant == main language code
+Code coverage: T with no variants
!! options
-language=zh variant=zh title=[[ZH]] showtitle
+language=zh variant=zh-tw showtitle
!! wikitext
--{T|zh-cn:CN;zh-tw:TW}-
-!! html
-ZH
+-{H|zh:China; zh-tw:Taiwan}-
+Taiwan is China.-{T|Taiwan is China}-
+!! html/php
+Taiwan is China
+Taiwan is Taiwan.
+!! html/parsoid
+
+Taiwan is China.
!! end
!! test
-Partly disable title conversion if variant == main language code, more
+Code coverage: rules with no variants
!! options
-language=zh variant=zh title=[[ZH]] showtitle
+language=zh variant=zh-tw
!! wikitext
--{T|TW}-
-!! html
+-{H|zh:China; zh-tw:Taiwan}-
+Taiwan is China.
+-{H|China}-
+Taiwan is China.
+!! html/php
+
+Taiwan is Taiwan.
+
+Taiwan is China.
+
+!! html/parsoid
+
+Taiwan is China.
+
+Taiwan is China.
+!! end
+
+
+!! test
+Code coverage: D flag for conversion rule
+!! options
+language=zh variant=zh-tw
+!! wikitext
+-{D|zh-cn:XA; zh-tw:YA}-
+-{A;D|zh-cn:XB; zh-tw:YB}-
+-{D;H|zh-cn:XC; zh-tw:YC}-
+
+-{D;H|FOO=>zh-tw:BAR;FOO=>zh-cn:BAT}-
+
+-{D|0=>zh-tw:1}-
+-{A;D|2=>zh-tw:3}-
+-{D;H|4=>zh-tw:5}-
+
+XA XB XC YA YB YC FOO BAR BAT 012345
+!! html/php
+
+!! end
+
+!! test
+Code coverage: N flag for conversion rule
+!! options
+language=zh variant=zh-cn
+!! wikitext
+-{N|zh-cn}-
+
+-{N|zh-tw}-
+
+-{N|sr-ec}-
+!! html/php
+
大é
+
å°ç£
+
ÑÑпÑки (ÑиÑилиÑа)â
+
+!! html/parsoid
+
+
+
+!! end
+
+# html2wt suppresses the bogus 'D' flag, so this is wt2html only
+!! test
+Code coverage: N flag for conversion rule (wt2html only)
+!! options
+language=zh variant=zh-cn
+parsoid=wt2html,html2html
+!! wikitext
+-{D;N|en}-
+!! html/php
+
English
+
+!! html/parsoid
+
+!! end
+
+!! test
+Testing that changing the language variant here in the tests actually works
+!! options
+language=zh variant=zh showtitle
+!! wikitext
+Should be stripped-{T|zh:China; zh-tw:Taiwan}-!
+!! html/php
+China
+
Should be stripped!
+
+!! html/parsoid
+
Should be stripped!
+!! end
+
+!! test
+Recursive conversion of alt and title attrs shouldn't clear converter state
+!! options
+language=zh variant=zh-cn
+showtitle
+!! wikitext
+-{H|zh-cn:Exclamation; zh-tw:exclamation}-
+Should be stripped-{T|zh-cn:China; zh-tw:Taiwan}-!
+!! html/php
+China
+
+Should be stripped!
+
+!! html/parsoid
+
+Should be stripped!
+!! end
+
+!! test
+T26072: more test on conversion rule for title
+!! options
+language=zh variant=zh-tw showtitle
+!! wikitext
+This should be stripped-{T|zh:China; zh-tw:Taiwan}-!
+
+This won't take interferes with the title rule-{H|zh:Beijing; zh-tw:Taipei}-.
+!! html/php
+Taiwan
+
This should be stripped!
+
This won't take interferes with the title rule.
+
+!! html/parsoid
+
This should be stripped!
+
This won't take interferes with the title rule.
+!! end
+
+!! test
+Partly disable title conversion if variant == main language code
+!! options
+language=zh variant=zh title=[[ZH]] showtitle
+!! wikitext
+-{T|zh-cn:CN;zh-tw:TW}-
+!! html/php
ZH
+!! html/parsoid
+
+!! end
+
+!! test
+Partly disable title conversion if variant == main language code, more
+!! options
+language=zh variant=zh title=[[ZH]] showtitle
+!! wikitext
+-{T|TW}-
+!! html/php
+ZH
+
+
+!! html/parsoid
+
!! end
!! test
@@ -21303,9 +22135,26 @@ Raw output of variant escape tags (R flag)
language=zh variant=zh-tw
!! wikitext
Raw: -{R|zh:China;zh-tw:Taiwan}-
-!! html
+!! html/php
Raw: zh:China;zh-tw:Taiwan
+!! html/parsoid
+
Raw:
+!! end
+
+# html2wt suppresses the bogus 'D' flags, so this is wt2html only
+!! test
+Raw output of variant escape tags (R flag) (wt2html only)
+!! options
+language=zh variant=zh-tw
+parsoid=wt2html,html2html
+!! wikitext
+-{Variant}- -{D|syntax}- -{D;R|options}-
+!! html/php
+
Variant syntax options
+
+!! html/parsoid
+
!! end
!! test
@@ -21314,9 +22163,24 @@ Nested markup inside raw output of variant escape tags (R flag)
language=zh variant=zh-tw
!! wikitext
Nested raw: -{R|nested -{zh:China;zh-tw:Taiwan}- nested}-
-!! html
+!! html/php
Nested raw: nested Taiwan nested
+!! html/parsoid
+
Nested raw:
+!! end
+
+!! test
+Nested markup and spaces inside raw output of variant escape tags (R flag)
+!! options
+language=zh variant=zh-tw
+!! wikitext
+X-{ outer -{ inner }- outer }-X
+!! html/php
+
X outer inner outer X
+
+!! html/parsoid
+
XX
!! end
!! test
@@ -21325,9 +22189,11 @@ Templates inside raw output of variant escape tags (R flag)
language=zh variant=zh-tw
!! wikitext
Nested raw: -{R|nested {{echo|hi}} templates}-
-!! html
+!! html/php
Nested raw: nested hi templates
+!! html/parsoid
+
Nested raw:
!! end
!! test
@@ -21336,9 +22202,11 @@ Strings evaluating false shouldn't be ignored by Language converter (T51072)
language=zh variant=zh-cn
!! input
-{zh-cn:0;zh-sg:1;zh-tw:2;zh-hk:3}-
-!! result
+!! html/php
0
+!! html/parsoid
+
!! end
!! test
@@ -21347,31 +22215,37 @@ Conversion rules from [numeric-only string] to [something else] (T48634)
language=zh variant=zh-cn
!! input
-{H|0=>zh-cn:B}--{H|0=>zh-cn:C;0=>zh-cn:D}--{H|0=>zh-hans:A}-012345-{A|zh-tw:0;zh-cn:E;}-012345
-!! result
+!! html/php
D12345EE12345
+!! html/parsoid
+
012345012345
!! end
!! test
-Bidirectional converter rule entries with an empty value should be ignored (T53551)
+Two-way converter rule entries with an empty value should be ignored (T53551)
!! options
language=zh variant=zh-cn
!! input
-{H|zh-cn:foo;zh-tw:;}-foobar
-!! result
+!! html/php
foobar
+!! html/parsoid
+
foobar
!! end
!! test
-Unidirectional converter rule entries with an empty "from" string should be ignored (T53551)
+One-way converter rule entries with an empty "from" string should be ignored (T53551)
!! options
language=zh variant=zh-cn
!! input
-{H|=>zh-cn:foo;}-foobar
-!! result
+!! html/php
foobar
+!! html/parsoid
+
foobar
!! end
!! test
@@ -21380,9 +22254,11 @@ Empty converter rule entries shouldn't be inserted into the conversion table (T5
language=zh variant=zh-cn
!! input
-{H|}-foobar
-!! result
+!! html/php
foobar
+!! html/parsoid
+
foobar
!! end
!! test
@@ -21391,9 +22267,11 @@ Nested using of manual convert syntax
language=zh variant=zh-hk
!! wikitext
Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
-!! html
+!! html/php
Nested: Hello Hong Kong!
+!! html/parsoid
+
Nested: !
!! end
!! test
@@ -21402,25 +22280,146 @@ HTML markups with conversion syntax in attribs, nested in other conversion block
language=zh variant=zh-cn
!! wikitext
-{zh;zh-hans;zh-hant|A}-
-!! html
+!! html/php
A
+!! html/parsoid
+
!! end
!! test
-HTML markups with conversion syntax in attribs, nested in other conversion blocks (not working yet)
+HTML markups with conversion syntax in attribs, nested in other conversion blocks (not working yet in PHP parser)
!! options
-language=zh variant=zh-cn disabled
+language=zh variant=zh-cn
!! wikitext
-{A}-
-!! html
+!! html/php+disabled
A
+!! html/parsoid
+
+!! end
+
+# Parsoid and PHP disagree on how to parse this example: Parsoid
+# insists that the content of a language converter element be a valid
+# DOM fragment or attribute string
+!! test
+Language converter markup with block content
+!! options
+language=zh variant=zh-cn
+!! wikitext
+a-{b
c}-d
+
+a-{zh;zh-hans;zh-hant|b
c}-d
+
+a-{H|0=>zh-cn:xy;0=>zh-tw:b
c}-d
+!! html/php+tidy
+
ab
+
cd ab
+
cd ad
+
+!! html/parsoid
+
a
d
+
+
a
d
+
+
ad
+!! end
+
+!! test
+LanguageConverter selser (1)
+!! options
+language=zh variant=zh-cn
+parsoid={
+ "modes": ["wt2wt", "selser"],
+ "changes": [
+ ["span[typeof]", "attr", "data-mw-variant", "{\"disabled\":{\"t\":\"edited\"}}"]
+ ]
+}
+!! wikitext
+-{raw}-
+!! wikitext/edited
+-{edited}-
+!! end
+
+!! test
+LanguageConverter selser (2)
+!! options
+language=zh variant=zh-cn
+parsoid={
+ "modes": ["wt2wt", "selser"],
+ "changes": [
+ ["span[class='x']", "contents", "text", "-{foo}-"],
+ ["a", "contents", "text", "-{"],
+ ["span[typeof]", "attr", "data-mw", "{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"-{\"}},\"i\":0}}]}"]
+ ]
+}
+!! wikitext
+TEXT1
+[http://example.com TEXT2]
+[[Foo|TEXT3]]
+{{echo|TEXT4}}
+!! wikitext/edited
+-{foo}-
+[http://example.com -{]
+[[Foo|-{]]
+{{1x|-{}}
+!! end
+
+# Tests LanguageVariantText in ConstrainedText
+!! test
+LanguageConverter selser (3)
+!! options
+language=zh variant=zh-cn
+parsoid={
+ "modes": ["wt2wt", "selser"],
+ "changes": [
+ ["td > span", "attr", "typeof", "mw:LanguageVariant"],
+ ["td > span", "attr", "data-mw-variant", "{\"disabled\":{\"t\":\"edited\"}}"]
+ ]
+}
+!! wikitext
+{|
+|-
+|Foo
+|}
+!! wikitext/edited
+{|
+|-
+|-{edited}-
+|}
+!! end
+
+# Tests LanguageVariantText._fromSelSer
+!! test
+LanguageConverter selser (4)
+!! options
+language=zh variant=zh-cn
+parsoid={
+ "modes": ["wt2wt", "selser"],
+ "changes": [
+ ["td > span.x", "remove"]
+ ]
+}
+!! wikitext
+{|
+|-
+|Foo-{Bar}-
+||Foo-{Bar}-
+|}
+!! wikitext/edited
+{|
+|-
+|-{Bar}-
+||-{Bar}-
+|}
!! end
# Since Parsoid is starting to emit canonical wikitext for links,
# [http://example.com http://example.com] will not RT back to that
# form anymore.
+# Parsoid does not language-convert links (it is done in a
+# post-processing step)
!! test
Proper conversion of text in external links
!! options
@@ -21449,8 +22448,8 @@ gopher://www.google.com
http://www.google.comgopher://www.google.comirc://www.google.com
-www.гоогле.Ñом/ÑÑп://диÑ
-www.гоогле.Ñом
+www.google.com/ftp://dir
+www.google.com
!! end
!! test
@@ -21459,9 +22458,11 @@ Do not convert roman numbers to language variants
language=sr variant=sr-ec
!! wikitext
Fridrih IV je car.
-!! html
+!! html/php
ФÑидÑÐ¸Ñ IV Ñе ÑаÑ.
+!! html/parsoid
+
Fridrih IV je car.
!! end
!! test
@@ -21481,9 +22482,11 @@ Don't convert raw rule "-{R|=>}-" to "=>"
language=sr
!! wikitext
-{R|=>}-
-!! html
+!! html/php
=>
+!! html/parsoid
+
!!end
!! test
@@ -21492,9 +22495,11 @@ Don't break link parsing if language converter markup is in the caption.
language=sr variant=sr-ec
!! wikitext
[[Main Page|-{R|main page}-]]
-!! html
+!! html/php
!! end
!! test
@@ -21506,6 +22511,8 @@ language=sr variant=sr-ec
!! html/php
foo
+!! html/parsoid
+
!! end
!! test
@@ -21513,12 +22520,12 @@ T146305: Don't break image parsing if language converter markup is in the captio
!! options
language=sr
!! wikitext
-[[File:Foobar.jpg|thumb|-{R|caption:}-]]
+[[ÐаÑоÑека:Foobar.jpg|thumb|-{R|caption:}-]]
!! html/php
caption:
!! html/parsoid
-
+
!! end
!! test
@@ -21526,14 +22533,15 @@ T146305: Don't break image parsing if nested language converter markup is in the
!! options
language=zh variant=zh-cn
!! wikitext
-[[File:Foobar.jpg|thumb|-{zh-cn:blog (hk: -{zh-hans|WEBJOURNAL}-, tw: -{zh-hans|WEBLOG}-)}-]]
+[[File:Foobar.jpg|thumb|-{|zh-cn:blog (hk: -{zh-hans|WEBJOURNAL}-, tw: -{zh-hans|WEBLOG}-)}-]]
!! html/php
blog (hk: WEBJOURNAL, tw: WEBLOG)
!! html/parsoid
-
+
!! end
+# XXX html2wt disabled because rich markup in alt is not preserved.
!! test
Don't break gallery if language converter markup is inside.
!! options
@@ -21543,7 +22551,7 @@ language=zh
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
-!! html
+!! html/php
!! end
@@ -21608,22 +22625,23 @@ T153135: Nested language converter markup in definition list (code coverage)
!! options
language=zh variant=zh-cn
!! wikitext
-;-{zh-cn:AAA -{zh-hans|foo:bar}- -{R|bat:baz}-}-:def
+;-{|zh-cn:AAA -{zh-hans|foo:bar}- -{R|bat:baz}-}-:def
!! html/php
AAA foo:bar bat:baz
def
!! html/parsoid
-
-
-
def
+
+
def
!! end
+# html2wt mode disabled due to insertion.
!! test
T153140: Don't break table handling if language converter markup is in the cell.
!! options
language=sr variant=sr-ec
+parsoid=wt2html,wt2wt,html2html
!! wikitext
{|
|-
@@ -21638,11 +22656,127 @@ language=sr variant=sr-ec
!! html/parsoid
-
+
-
B
-
+
+
+
+
+!! end
+!! test
+Language converter tricky html2wt cases (1)
+!! options
+language=sr
+parsoid=html2wt,wt2wt
+!! html/parsoid
+
+!! wikitext
+-{}-}-
+!! html/php
+
}-
+
+!! end
+
+!! test
+Language converter tricky html2wt cases (2)
+!! options
+language=sr
+parsoid=html2wt,wt2wt
+!! html/parsoid
+
-{foo}-
+!! wikitext
+-{foo}-
+!! html/php
+
-{foo}-
+
+!! end
+
+!! test
+Language converter tricky html2wt cases (3)
+!! options
+language=sr
+parsoid=html2wt,wt2wt
+!! html/parsoid
+
+!! end
+
+!! test
+Language converter tricky html2wt cases (4)
+!! options
+language=sr
+parsoid=html2wt,wt2wt
+!! html/parsoid
+
+!! wikitext
+-{R|{{echo|hey}}}-
+!! html/php
+
hey
+
+!! end
+
+# Note that the escaping added by parsoid for source text,
+# destination text, and language names only works on the PHP side
+# for *destination text*. (HTML entity escaping wouldn't work
+# any better.) This is probably a bug, at least for source texts.
+# (For language names PHP uses a precise regexp based on the languages
+# it currently knows have variants, which is fragile since this set
+# can grow/shrink over time.)
+!! test
+Language converter tricky html2wt cases (5)
+!! options
+language=zh variant=zh-cn
+!! html/parsoid
+
+!! end
+
+!! test
+T179579: Nowiki and lc interaction
+!! options
+parsoid=wt2html
+language=sr
+!! wikitext
+-{123}-
+
+-{123|456}-
+!! html/parsoid
+
+
+
!! end
!! test
@@ -23421,9 +24555,7 @@ parsoid=wt2html,wt2wt
!! wikitext
'''[[Image:Foobar.jpg|right|300px]]'''
!! html/parsoid
-
-
-
+
!! end
#### ----------------------------------------------------------------
@@ -23498,12 +24630,12 @@ Empty LI and TR nodes should not be stripped from top-level content
!! html/parsoid
a
-
+
b
-
+
foo
@@ -23517,9 +24649,9 @@ Empty TR nodes should not be stripped if they have any attributes set
{{EmptyTRWithHTMLAttrTest}}
!! html/parsoid
-
+
foo
-
+
bar
!! end
@@ -24805,7 +25937,7 @@ parsoid=html2wt
'foo[1]
'foo
!! wikitext
[[:fr:Foo|Foo]]
[[:fr:Foo|Foo]]
[[:fr:Foo|Foo]]
[[:fr:Foo|Foo]]
+[[:fr:Foo|Foo]]
+[[:fr:Foo|Foo]]
+
[[:fr:Foo|Foo]]
[[:fr:Foo|Foo]]
!! end
@@ -26225,7 +27362,7 @@ Image: Block level image should have \n before and after
123
456
-!!end
+!! end
!! test
Image: New block level image should have \n before and after (existing content)
@@ -26237,7 +27374,7 @@ Image: New block level image should have \n before and after (existing content)
123
456
-!!end
+!! end
!! test
Image: upright option (parsoid)
@@ -26249,7 +27386,7 @@ Image: upright option (parsoid)
captioncaptioncaption
-!!end
+!! end
!! test
Image: upright option is ignored on inline and frame images (parsoid)
@@ -26257,7 +27394,15 @@ Image: upright option is ignored on inline and frame images (parsoid)
[[File:Foobar.jpg|500x500px|upright=0.5|caption]]
!! html/parsoid
-!!end
+!! end
+
+!! test
+Image: in template parameter with empty parameter
+!! wikitext
+{{echo|[[File:Foobar.jpg|link=]]}}
+!! html/parsoid
+
+!! end
!! test
Image: from basic HTML (1)
@@ -28316,19 +29461,197 @@ unclosed internal link XSS (T137264)