!! endarticle
+!! article
+Template:blank_param
+!! text
+{{{1}}}
+{{{}}}
+!! endarticle
+
!! article
Template:table_attribs
!! text
@@ -153,6 +160,22 @@ Template:table_attribs_5
|style="color:red;"||Bar
!! endarticle
+!! article
+Template:table_attribs_6
+!! text
+style="background:
+
+
+red;" |
+!! endarticle
+
+!! article
+Template:table_attribs_7
+!! text
+
+|style{{=}}"background:#f9f9f9;"|Foofoo
+!! endarticle
+
!! article
Template:table_header_cells
!! text
@@ -165,6 +188,13 @@ Template:table_cells
{{table_attribs}}||style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz
!! endarticle
+!! article
+Template:PartialTable
+!! text
+{|
+|-
+!! endarticle
+
!! article
Template:image_attribs
!! text
@@ -808,15 +838,12 @@ 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
Italics and bold: 5-quote opening sequence: (5,2+3)
-!! options
-parsoid=wt2wt,html2wt
!! wikitext
'''''foo'''''
-!! html
-
foo
+!! html/*
+
foo
!! end
@@ -1300,7 +1327,7 @@ Non-word characters don't terminate tag names + tidy
Non-word characters are valid in extension tags (T19663)
!! wikitext
tåg
-!! html
+!! html/php
'tåg'
array (
@@ -1311,11 +1338,15 @@ array (
!! test
Isolated close tags should be treated as literal text (bug 52760)
+!! options
+parsoid=wt2html
!! wikitext
s
-!! html+tidy
+!! html/php+tidy
+
<s.foo>s
+!! html/parsoid
<s.foo>s
!! end
@@ -1349,9 +1380,11 @@ Bare pipe character from a template (bug 52363)
unordered list
!! wikitext
* This is not an unordered list item.
-!! html
+!! html/php
* This is not an unordered list item.
+!! html/parsoid
+
* This is not an unordered list item.
!! end
!! test
@@ -1364,7 +1397,7 @@ sed abit.
:and a colon
-!! html
+!! html/php
Lorem ipsum dolor
sed abit.
@@ -1373,6 +1406,14 @@ sed abit.
:and a colon
+!! html/parsoid
+
Lorem ipsum dolor
+
+sed abit.
+ sed nullum.
+
+:and a colon
+
!! end
!! test
@@ -1386,7 +1427,7 @@ nowiki 3
*There is not nowiki.
*There is nowiki.
-!! html
+!! html/php
There is not nowiki.
There is nowiki.
There is not nowiki.
@@ -1394,6 +1435,15 @@ nowiki 3
There is not nowiki.
There is nowiki.
+!! html/parsoid
+
There is not nowiki.
+
There is nowiki.
+
+
There is not nowiki.
+
There is nowiki.
+
+
There is not nowiki.
+
There is nowiki.
!! end
!! test
@@ -1407,11 +1457,11 @@ Entities inside
!! test
Entities inside template parameters
-!! options
-parsoid
!! wikitext
{{echo|–}}
-!! html
+!! html/php+tidy
+
–
+!! html/parsoid
–
!! end
@@ -1419,17 +1469,27 @@ parsoid
Properly escape nowiki when combined with other wiki markup
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
* </nowiki> tag
!! wikitext
-* </nowiki> tag
+*</nowiki> tag
+!! end
+
+!! test
+T93824: Put escaped HTML tags inside nowiki
+!! options
+parsoid=html2wt
+!! html/parsoid
+
<h2>foo</h2>
+!! wikitext
+
foo
!! end
!! test
T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
This text: L'Foo
This text: L''Foo
This text: L'''Foo''
@@ -1444,7 +1504,7 @@ This text: L'''[[Foo]]''
T71950: 2. Put nowiki as close to cause as possible, after ' :'
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
@@ -1483,6 +1543,30 @@ parsoid=html2wt
{{echo|a }}}
!! end
+!! test
+Cases where "!!" needs nowiki protection
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+
this needs protection !! here
+
+
+
+
this does not need
+protection !! here
+
+!! wikitext
+{|
+!this needs protection !! here
+|}
+
+{|
+!this does not need
+protection !! here
+|}
+!! end
+
###
### Comments
###
@@ -1587,8 +1671,10 @@ Comment whitespace
Comment semantics and delimiters
!! wikitext
-!! html
+!! html/php
+!! html/parsoid
+
!! end
!! test
@@ -1596,8 +1682,11 @@ Comment semantics and delimiters, redux
!! wikitext
-!! html
+!! html/php
+!! html/parsoid
+
!! end
!! test
@@ -1607,39 +1696,68 @@ Comment semantics and delimiters: directors cut
everything starting with < followed by !-- until the first -- and > we see,
that wouldn't be valid XML however, since in XML -- has to terminate a comment
-->-->
-!! html
+!! html/php
-->
+!! html/parsoid
+
-->
!! end
!! test
Comment semantics: nesting
!! wikitext
-->
-!! html
+!! html/php
-->
+!! html/parsoid
+
-->
!! end
+# Parsoid closes the unclosed comment, even if it means a slight
+# round-trip diff.
!! test
Comment semantics: unclosed comment at end
+!! options
+parsoid=wt2html,html2html
!! wikitext
!! end
-# Bug 58184: document parsoid's behaviour
!! test
-Suppress comment closing tag in lenient browsers
-!! options
-parsoid=wt2html,html2html
+Comment semantics: normalize comments to play nice with XML and browsers
!! wikitext
- think this is closed -->
+ think this is closed -->
+ This would normally be text -->
+ As would this -->
+
+
+But this is not a comment.
!! html/php
+
But this is not a comment.
+
+!! html/parsoid
+
+
+
+
+
+
But this is not a comment.
+!! end
+!! test
+Comment semantics: round-trip even text which contains encoded -->
+!! wikitext
+
!! html/parsoid
-
+
!! end
!! test
@@ -1682,10 +1800,15 @@ parsoid=wt2html,wt2wt
!! wikitext
*a
*b
-!! html
-
+!! html/php
+
a
+
b
+
+!! html/parsoid
+
a
+
b
@@ -1894,7 +2017,7 @@ a [[Category:A1]] [[Category:A2]]
[[Category:A4]]
!! html/parsoid
a
-
+
!! end
!! test
@@ -1904,7 +2027,7 @@ parsoid=wt2html
!! wikitext
[[Category:A1]]a
!! html/parsoid
-
a
+
a
!! end
###
@@ -1934,13 +2057,28 @@ Tabs don't trigger preformatted text
preformatted text.
This is preformatted text.
So is this.
-!! html
+!! html/php
This is not
preformatted text.
This is preformatted text.
So is this.
+!! html/parsoid
+
This is not
+ preformatted text.
+
This is preformatted text.
+ So is this.
+!! end
+
+!! test
+Space before tab needs nowiki pre protection
+!! options
+parsoid=html2wt
+!! html/parsoid
+
a
+!! wikitext
+ a
!! end
!! test
@@ -2140,7 +2278,7 @@ Entities inside
-!! html
+!! html/php
<nowiki>
@@ -2153,6 +2291,18 @@ Entities inside
</pre>
+!! html/parsoid
+
<nowiki>
+
+
</nowiki>
+</pre>
+
+
+<pre>
+<nowiki>
+</pre>
+
+</pre>
!! end
!! test
@@ -2209,13 +2359,17 @@ HTML pre followed by indent-pre
!! end
+# Note that tidy removes the empty
tags from the start and end.
+# Parsoid does not, by design.
!!test
Block tag pre
-!!options
-parsoid
!! wikitext
foo
-!! html
+!! html/php+tidy
+
+foo
+
+!! html/parsoid
foo
!!end
@@ -2338,6 +2492,19 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
!!end
+!! test
+Pres with newline attributes
+!! wikitext
+
hi
+!! html/php
+
hi
+
+!! html/parsoid
+
hi
+!! end
+
!! test
Things that look like
tags aren't treated as such
!! wikitext
@@ -2377,7 +2544,10 @@ Parsoid: handle pre with space after attribute
parsoid=wt2html
!! wikitext
{{echo|foo}}
-!! html
+!! html/php
+
{{echo|foo}}
+
+!! html/parsoid
{{echo|foo}}
!! end
@@ -2583,32 +2753,32 @@ Templates: Other wikitext in parameter names (bug 67657)
#--------------------------------------------------------------------
!! test
Templates: Parsoid parameter escaping test 1
-!! options
-parsoid
!! wikitext
{{echo|[foo]|{{echo|[bar]}}}}
-!! html
+!! html/php+tidy
+
[foo]
+!! html/parsoid
[foo]
!! end
!! test
Parsoid: Pipes in external links in template parameter
-!! options
-parsoid
!! wikitext
{{echo|[{{echo|http://example.com}} link]}}
-!! html
+!! html/php+tidy
+
@@ -2620,7 +2790,9 @@ Parsoid: Pipe in external link target and content in template parameter
parsoid=html2wt,wt2wt
!! wikitext
{{echo|[http://foo.com/a|b a|b]}}
-!! html
+!! html/php+tidy
+
!!end
###
@@ -3570,20 +3777,26 @@ Definition Lists: Hacky use to indent tables, with comment before table
!! end
-# Bug 52473
+# The trailing whitespace in this test is to catch a regression in
+# Parsoid after T54473.
!! test
Definition Lists: Hacky use to indent tables (WS-insensitive)
-!! options
-parsoid
!! wikitext
: {|
|a
|}
-!! html
-
-
a
-
+!! html/php
+
+
+
a
+
+
+!! html/parsoid
+
+
a
+
!! end
+
## The PHP parser treats : items (dd) without a corresponding ; item (dt)
## as an empty dt item. It also ignores all but the last ";" when followed
## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in
@@ -3616,7 +3829,7 @@ parsoid
##
## All Parsoid only definition list tests have this difference.
##
-## See also: https://bugzilla.wikimedia.org/show_bug.cgi?id=6569
+## See also: https://phabricator.wikimedia.org/T8569
## and http://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html
!! test
@@ -3706,12 +3919,19 @@ parsoid
!! test
Definition Lists: Nesting: Test 2 (Parsoid only)
-!! options
-parsoid
!! wikitext
;t1
::d2
-!! html
+!! html/php+tidy
+
+
t1
+
+
+
d2
+
+
+
+!! html/parsoid
t1
@@ -3726,12 +3946,27 @@ parsoid
!! test
Definition Lists: Nesting: Test 3 (Parsoid only)
-!! options
-parsoid
!! wikitext
:;t1
::::d2
-!! html
+!! html/php+tidy
+
+
+
+
t1
+
+
+
+
+
d2
+
+
+
+
+
+
+
+!! html/parsoid
@@ -4006,6 +4241,9 @@ Definition Lists: Mixed Lists: Test 11
# Another case where tidy converts a
to a
(but Parsoid doesn't).
+# From whitelist:
+# * The test is wrong, there are two colons where there should be :;
+# * The PHP parser is wrong to close the
after the
containing the
.
!! test
Definition Lists: Weird Ones: Test 1
!! wikitext
@@ -4063,7 +4301,7 @@ Definition Lists: Weird Ones: Test 1
-
foo
+
foo
bar (who uses this?)
@@ -4120,6 +4358,17 @@ Definition Lists: colons occurring in tags
+!! html/parsoid
+
a
b
+
a:b
+
a:b
+
a:b
+
a:b
+
a
+
b
+
a:b
+
a:b
+
a:b
!! end
!! test
@@ -4440,6 +4689,25 @@ http://example.com/url_with_entity<
http://example.com/url_with_entity<
!! end
+!! test
+External links: Lone protocols are never linked (T105697)
+!! wikitext
+http://
+http://;
+(http://)
+bitcoin:
+bitcoin:;
+(bitcoin:)
+!! html
+
+!! end
+
!! test
External links: No preceding word characters allowed (bug 65278)
!! wikitext
@@ -4981,38 +5249,6 @@ External link containing a single quote. (bug 63947)
!! end
-
-!! test
-External link containing a period in the anchor. (bug 63947)
-!! wikitext
-[//foo.org/bar#baz. bang]
-
-[//foo.org/bar. bang]
-!! html/php
-
-!! end
-
-
!! test
External link containing double-single-quotes in text '' (bug 4598 sanity check)
!! wikitext
@@ -5048,9 +5284,22 @@ External link containing double-single-quotes with no space separating the url f
External link with comments in link text
!! wikitext
[http://www.google.com Google ]
-!! html
+!! html/php
!! end
!! test
@@ -5113,7 +5477,8 @@ Non-extlinks in brackets
[{{echo|foo}}l's errand]
[url={{echo|foo}}]
[url=http://example.com]
-!! html
+[http:// bare protocols don't count]
+!! html/php
+!! wikitext
+[[Foo|Bar]]
+[[Foo|Bar]]
+[[wikipedia:Foo|Bar]]
+[[wikipedia:Foo|Bar]]
+
+[[wikipedia:European_Robin|European Robin]]
+[[wikipedia:European_Robin|European Robin]]
+!! end
+
+!! test
+mw:ExtLink linking to a interwiki URL can be round-tripped losslessly (T94723)
+!! options
+parsoid=wt2wt
!! wikitext
-[[MediaWiki:Badtitletext|Manual]]
+[http://en.wikipedia.org/wiki/European_Robin European Robin]
+!! html/parsoid
+THIS SECTION IS NOT USED (but Parsoid won't run the test without it)
!! end
+
###
### Quotes
###
@@ -5280,7 +5700,9 @@ Plain ''italic'''s plain
Bold tag left open
Italic tag left open
Normal text.
-
This year's election should beat last year's.
+
+
+
This year's election should beat last year's.
Toms car is bigger than Susans.
Plain italic's plain
@@ -5480,6 +5902,7 @@ Simple table but with multiple dashes for row wikitext
!! end
+
!! test
Multiplication table
!! wikitext
@@ -5600,6 +6023,69 @@ Accept "||" in indented table headings
!! end
+!! test
+Accept "!!" in templates
+!! wikitext
+{|
+!a {{echo|b!!c}}
+|}
+!! html/php
+
+
+
a b
+
c
+
+
+!! html/parsoid
+
+
a b
c
+!! end
+
+!! test
+Accept "!!" in table headings after newline
+!! wikitext
+{|
+!a
+b!!c
+|}
+!! html/php
+
+
+
a
+
b!!c
+
+
+
+!! html/parsoid
+
+
a
+
b!!c
+
+!! end
+
+!! test
+Accept "!!" in table data of mixed wikitext / html syntax
+!! wikitext
+{|
+!a
+
b!!c
+|}
+!! html+tidy
+
+
+
a
+
+
+
b!!c
+
+
+!! html/parsoid
+
+
a
+
b!!c
+
+!! end
+
!! test
Accept empty attributes in td/th cells (td/th cells starting with leading ||)
!! wikitext
@@ -5746,10 +6232,37 @@ Invalid attributes in table cell (bug 1830)
!! end
-# The "|}" to close the table is missing from the input, so parsoid's
-# *2wt modes will fail.
!! test
-Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
+Table cell attributes: Pipes protected by nowikis should be treated as a plain character
+!! wikitext
+{|
+| title="foo" |bar
+| title="foo|" |bar
+| title="foo|" bar
+|}
+!! html/php
+
+
+
bar
+
+
bar
+
+
title="foo|" bar
+
+
+!! html/parsoid
+
+
bar
+
bar
+
title="foo|" bar
+
+!! end
+
+# See: http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html
+# N.B. The "|}" to close the table is missing from the input, so parsoid's
+# *2wt modes will fail.
+!! test
+Table security: embedded pipes
!! options
parsoid=wt2html,html2html
!! wikitext
@@ -5767,12 +6280,14 @@ parsoid=wt2html,html2html
!! html/parsoid
-
" onmouseover="alert(document.cookie)">test
+
" onmouseover="alert(document.cookie)">test
!! end
-# FIXME: The php output is broken.
+# FIXME: The output seems broken. Filed as T110268.
!! test
! and || in td attributes should not be parsed as
/
+!! options
+parsoid=wt2html
!! wikitext
{|
| style="color: red !important;" data-contrived="put this here ||" | foo
@@ -5786,7 +6301,7 @@ parsoid=wt2html,html2html
!! html/parsoid
-
foo
+
style="color: red !important;" data-contrived="put this here
foo
!! end
@@ -5892,6 +6407,50 @@ Indented table markup mixed with indented pre content (proposed in bug 6200)
!! end
+!! test
+4. Template-generated table cell attributes and cell content inside a templated table
+!! wikitext
+{{tbl-start}}
+!align=center {{table_header_cells}}
+|-
+|align=center {{table_cells}}
+{{tbl-end}}
+!! html/php
+
+
+
Foo
+
Bar
+
Foo and Baz
+
+
+
Foo
+
Bar
+
Foo and Baz
+
+
+!! html/parsoid
+
+
Foo
Bar
Foo and Baz
+
+
Foo
Bar
Foo and Baz
+
+!! end
+
+## Edge case fix to prevent future regressions
+!! test
+T107652: s in templates that also generate table cell attributes should be rendered properly
+!! wikitext
+{|
+|{{table_attribs_7}}
+|}
+
+!! html/parsoid
+
+!! end
+
!! test
Table with row followed by newlines and table heading
!! wikitext
@@ -6305,7 +6864,7 @@ parsoid=wt2html,wt2wt
Parsoid: Default to a newline after tables in new content (bug 51219)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
bar
@@ -6325,7 +6884,7 @@ parsoid=html2wt
Parsoid: newline inducing block nodes don't suppress
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a
foo
!! wikitext
a
@@ -6359,9 +6918,6 @@ parsoid=wt2html,wt2wt
!! end
-
-# PHP throws away the (semi-broken) "foo" class here; Parsoid
-# preserves it.
!!test
Parsoid: Recover better from broken table attributes
!!options
@@ -6372,7 +6928,7 @@ parsoid=wt2html
foo
|}
!!html/php+tidy
-
+
foo
@@ -6387,11 +6943,28 @@ foo
!!end
+!! test
+Tables: Digest broken attributes on table and tr tag
+!! options
+parsoid=wt2html
+!! wikitext
+{| || |} ++
+|- || || ++ --
+|- > [
+|}
+!! html
+
+
+
+
+
+!! end
+
!! test
Strip unsupported table tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -6597,8 +7170,10 @@ Link with HTML entity in suffix / tail
Link with 3 brackets
!! wikitext
[[[Main Page]]]
+Foo [[[Main Page]]]
!! html
[[[Main Page]]]
+Foo [[[Main Page]]]
!! end
@@ -6696,7 +7271,7 @@ Namespace takes precedence over interwiki link (bug 51680)
Link to namespace preferred over interwiki with correct rel attribute
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
!! end
!! test
@@ -7204,7 +7779,7 @@ mótmælenda[[söfnuður|söfnuðir]]xxx
Parsoid link trail escaping
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
@@ -7524,7 +8098,21 @@ Blah blah blah
-
+!! end
+
+!! test
+Space and question mark encoding in interlanguage links (T95473)
+!! options
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+Blah blah blah
+[[es:Foo bar?]]
+!! html/php
+
Blah blah blah
+
+!! html/parsoid
+
Blah blah blah
+
!! end
!! test
@@ -7587,7 +8175,7 @@ language=ln
Parsoid bug 53221: Wikilinks should be properly entity-escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
+mi:Template:Foo
!! end
###
@@ -7702,12 +8290,10 @@ Blah blah blah
!! test
1. Simple redirect to page
-!! options
-parsoid
!! wikitext
#REDIRECT [[Main Page]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
@@ -7718,12 +8304,22 @@ parsoid
!! end
+# Not a valid redirect in PHP (although perhaps it was, once upon a time)
+# This tests the Parsoid bail-out code.
!! test
3. Other redirect variants
!! wikitext
#REDIRECT [[[[Bar]]]]
!! html/parsoid
-
+
REDIRECT [[[[Bar]]]]
+!! end
+
+!! test
+4. Redirect to a templated destination
+!! wikitext
+#REDIRECT [[{{echo|Foo}}bar]]
+!! html/parsoid
+
!! end
!! test
@@ -7732,7 +8328,7 @@ Empty redirect
parsoid=wt2html,wt2wt
!! wikitext
#REDIRECT [[]]
-!! html
+!! html/parsoid
REDIRECT [[]]
!! end
@@ -7745,8 +8341,8 @@ Optional colon in #REDIRECT
parsoid=wt2html,html2html
!! wikitext
#REDIRECT:[[Main Page]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
@@ -7761,8 +8357,8 @@ parsoid=wt2html,html2html
#REDIRECT
:
[[Main Page]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
@@ -7773,89 +8369,90 @@ Piped link in #REDIRECT
parsoid=wt2html
!! wikitext
#REDIRECT [[Main Page|bar]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
-Redirect to category
+Redirect to category (T104502)
!! options
-parsoid=wt2wt,wt2html
+parsoid=wt2html,wt2wt
!! wikitext
#REDIRECT [[Category:Foo]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
-Redirect to category with URL encoding
+Redirect to category with URL encoding (T104502)
!! options
parsoid=wt2html
!! wikitext
#REDIRECT [[Category%3AFoo]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
Redirect to category page
-!! options
-parsoid
!! wikitext
#REDIRECT [[:Category:Foo]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
Redirect to image page (1)
-!! options
-parsoid
!! wikitext
#REDIRECT [[File:Wiki.png]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
Redirect to image page (2)
-!! options
-parsoid
!! wikitext
#REDIRECT [[Image:Wiki.png]]
-!! html
-
+!! html/parsoid
+
!! end
+# html2wt disabled because wts serializes as "#REDIRECT [[:en:File:Wiki.png]]"
+# Next test confirms this.
!! test
-Redirect to language
+Redirect to language (1) (T104918)
!! options
-parsoid
+parsoid=wt2html,wt2wt,html2html
!! wikitext
#REDIRECT [[en:File:Wiki.png]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
-Redirect to interwiki
-!! options
-parsoid
+Redirect to language (2) (T104918)
+!! wikitext
+#REDIRECT [[:en:File:Wiki.png]]
+!! html/parsoid
+
+!! end
+
+!! test
+Redirect to interwiki (T104918)
!! wikitext
#REDIRECT [[meatball:File:Wiki.png]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
Non-English #REDIRECT
!! options
-parsoid
language=is
!! wikitext
#TILVÍSUN [[Main Page]]
-!! html
-
+!! html/parsoid
+
!! end
!! test
@@ -7874,8 +8471,8 @@ some text
New redirect
!! options
parsoid=html2wt
-!! html
-
Foo
+!! html/parsoid
+
Foo
!! wikitext
Foo
#REDIRECT [[Foo]]
@@ -7980,8 +8577,8 @@ Handling html with a br self-closing tag
!! end
!! test
@@ -8258,11 +8855,15 @@ List items are not parsed correctly following a
block (bug 785)
*
foo
*
bar
* zar
-!! html
+!! html/php
foo
bar
zar
+!! html/parsoid
+
foo
+
bar
+
zar
!! end
!! test
@@ -9306,7 +9907,7 @@ hi+world%3F%21
Magic Word: prioritize type info over data-parsoid
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
__FORCETOC__
@@ -9320,7 +9921,7 @@ parsoid=wt2wt,html2wt
foo
__NOTOC__
bar
-!! html
+!! html/parsoid
foobar
!! end
@@ -9331,10 +9932,19 @@ parsoid=wt2wt
language=de
!! wikitext
__NOEDITSECTION__
-!! html
+!! html/parsoid
!! end
+!!test
+__proto__ is treated as normal wikitext (T105997)
+!!wikitext
+__proto__
+!!html
+
__proto__
+
+!!end
+
###
### Magic links
###
@@ -9342,27 +9952,33 @@ __NOEDITSECTION__
Magic links: internal link to RFC (bug 479)
!! wikitext
[[RFC 123]]
-!! html
+!! html/php
!! end
###
@@ -9642,9 +10278,11 @@ Template with default value (value set)
Template redirect
!! wikitext
{{templateredirect}}
-!! html
+!! html/php
(test)
+!! html/parsoid
+
!! end
!! test
@@ -9882,6 +10520,24 @@ Template with targets containing wikilinks
!! end
+!! article
+Template:''
+!! text
+bar
+!! endarticle
+
+!! test
+Templates: Double quotes as template target
+!! wikitext
+foo {{''}} baz
+!! html/php
+
foo bar baz
+
+!! html/parsoid
+
foo bar baz
+
+!! end
+
!! article
Template:MSGNW test
!! text
@@ -9892,6 +10548,7 @@ Template:MSGNW test
File:Foobar.jpg
+
!! endarticle
# hmm, fix this or just deprecate msgnw and document its behavior?
@@ -9899,7 +10556,7 @@ File:Foobar.jpg
msgnw keyword
!! wikitext
{{msgnw:MSGNW test}}
-!! html
+!! html/php
''None'' of '''this''' should be
* interpreted
but rather passed unmodified
@@ -9907,6 +10564,7 @@ msgnw keyword
<gallery>
File:Foobar.jpg
</gallery>
+<!-- comment -->
!! end
@@ -9919,6 +10577,15 @@ int keyword
!! end
+!! test
+int keyword - non-existing message
+!! wikitext
+{{int:var}}
+!! html
+
<var>
+
+!! end
+
!! article
Template:Includes
!! text
@@ -10160,7 +10827,7 @@ b}}
!! end
!! test
-Parsoid: Merge double tds (bug 50603)
+Parsoid: Merge double tds (T52603)
!! options
parsoid
!! wikitext
@@ -10174,7 +10841,7 @@ parsoid
!! end
!! test
-Parsoid: Merge double tds in nested transclusion content (bug 50603)
+Parsoid: Merge double tds in nested transclusion content (T52603)
!! options
parsoid
!! wikitext
@@ -10669,6 +11336,43 @@ Templates: Support for templates generating attributes and content
!! end
+!! test
+3. Entities and nowikis inside templated attributes should be handled correctly inside templated tables
+!! wikitext
+{{tbl-start}}
+|{{table_attribs_3}}
+{{tbl-end}}
+!! html/php
+
+
+
Foo
+
+
+!! html/parsoid
+
+
Foo
+
+!! end
+
+# T107622
+!! test
+4. Entities and nowikis inside templated attributes should be handled correctly inside templated tables
+!! wikitext
+{|
+| {{table_attribs_6}} hi
+|}
+!! html/php
+
+
+
hi
+
+
+!! html/parsoid
+
+
hi
+
+!! end
+
!!test
Templates: HTML Tables: 1. Generating start of a HTML table
!! wikitext
@@ -10896,6 +11600,46 @@ Templates: Wiki Tables: 6. Templated tags, templated td-tags
!!end
+## This test case is very specific to Parsoid's internals
+## and is hence only tested for Parsoid's code. Parsoid uses
+## a marker tag for tags and they are expanded
+## much later. We are verifying that this tag usage
+## doesn't prevent foster parenting.
+!!test
+Templates: Wiki Tables: 7. Fosterable s should get fostered
+!!wikitext
+{{PartialTable}}foo
+|}
+
+
+!!html/parsoid
+[1]
!! html/parsoid
-This is a caption
+This is a caption
!! end
!! test
@@ -11932,7 +12674,7 @@ parsoid=wt2html,wt2wt,html2html
This is a caption
!! html/parsoid
-This is a caption
+This is a caption
!! end
!! test
@@ -11989,7 +12731,7 @@ thumbsize=220
!! html/parsoid
123456
123
456
-
123
456
+
123
456
!! end
!! test
@@ -12011,7 +12753,7 @@ Image with multiple widths -- use last
!! html/parsoid
-
+
!! end
!! test
@@ -12027,7 +12769,7 @@ thumbsize=220
!! html/parsoid
-caption
+caption
!! end
@@ -12043,9 +12785,9 @@ Image with width attribute at different positions
!! html/parsoid
-Caption
-Caption
-Caption
+Caption
+Caption
+Caption
!! end
# a sad bit of backward-compatibility
@@ -12061,7 +12803,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
@@ -12100,7 +12842,22 @@ Image with link parameter, protocol-less URL target
!! end
!! test
-Image with link parameter, wgExternalLinkTarget
+Escaping non-block captions (T107435)
+!! options
+parsoid={
+ "modes": ["wt2wt"],
+ "changes": [
+ ["[typeof~='mw:Image']", "attr", "data-mw", "{\"caption\": \"|\"}"]
+ ]
+}
+!! wikitext
+[[Image:Foobar.jpg|caption]]
+!! wikitext/edited
+[[Image:Foobar.jpg||]]
+!! end
+
+!! test
+Image with link parameter, wgExternalLinkTarget
!! wikitext
[[Image:foobar.jpg|link=http://example.com/]]
!! config
@@ -12187,7 +12944,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid
-Title
+Title
!! end
!! test
@@ -12287,8 +13044,6 @@ parsoid=wt2html,wt2wt,html2html
!! test
Image with wiki markup in implicit alt
-!! options
-parsoid=wt2html,wt2wt,html2html
!! wikitext
[[Image:Foobar.jpg|testing '''bold''' in alt]]
@@ -12298,8 +13053,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12334,9 +13089,9 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
-
+
+
+
!! end
!! test
@@ -12372,15 +13127,15 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid
-caption
-caption
-caption
+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
+# and https://phabricator.wikimedia.org/T64258
# Foobar has actual size of 1941x220
# 1. Thumbs & frameless always reduce, can't be enlarged unless it's
# a scalable format.
@@ -12401,8 +13156,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12418,8 +13173,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12432,7 +13187,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
@@ -12448,8 +13203,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12462,7 +13217,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
@@ -12478,8 +13233,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12537,7 +13292,7 @@ Frameless image caption with a free URL
!! html/parsoid
-
+
!! end
!! test
@@ -12550,7 +13305,7 @@ thumbsize=220
!! end
!! test
@@ -12658,7 +13413,7 @@ BUG 648: Frameless image caption with a link (suffix)
!! html/parsoid
-
+
!! end
!! test
@@ -12669,7 +13424,7 @@ BUG 648: Frameless image caption with an interwiki link
!! html/parsoid
-
+
!! end
!! test
@@ -12680,7 +13435,15 @@ BUG 648: Frameless image caption with a piped interwiki link
!! html/parsoid
-
+
+!! end
+
+!! test
+T107474: Frameless image caption with
+!! wikitext
+[[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
+!! html/parsoid
+
!! end
!! test
@@ -12691,7 +13454,7 @@ Escape HTML special chars in image alt text
!! html/parsoid
-
+
!! end
!! test
@@ -12702,7 +13465,7 @@ BUG 499: Alt text should have Ӓ, not &1234;
!! html/parsoid
-
+
!! end
!! test
@@ -12726,7 +13489,7 @@ Image caption containing another image
This is a caption with another inside it!
!! html/parsoid
-This is a caption with another inside it!
+This is a caption with another inside it!
!! end
!! test
@@ -12750,7 +13513,7 @@ Image: caption containing leading space
bar
!! html/parsoid
- bar
+ bar
!!end
!! test
@@ -12769,7 +13532,7 @@ and some more text.]]
This is an example image thumbnail caption with a table
Foo
Bar
Foo1
Bar1
and some more text.
!! html/parsoid
-
This is an example image thumbnail caption with a table
+
This is an example image thumbnail caption with a table
Foo
Bar
@@ -12786,7 +13549,7 @@ Bug 3090: External links other than http: in image captions
!! html/parsoid
-This caption has irc and Secure ext links in it.
+This caption has irc and Secure ext links in it.
!! end
!! test
@@ -12828,7 +13591,7 @@ language=es
caption
!! html/parsoid
-caption
+caption
!! end
!! test
@@ -12842,7 +13605,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
# Note that 'right' is the default alignment, despite the misspelled 'righ' below
@@ -12863,9 +13626,9 @@ parsoid=wt2html,wt2wt,html2html
+!! end
###
### Subpages
@@ -13435,6 +14234,152 @@ Bar
!! end
+## The whitespace on the empty line is part of the test. Please do not delete
+!! test
+1. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87)
+!! options
+parsoid=wt2html,wt2wt
+!! wikitext
+This
+
+[[Category:Foo]] and this should be part of same paragraph (not an indent-pre)
+
+{{echo|[[Category:Foo]] and so should this!}}
+!! html
+
This and this should be part of same paragraph (not an indent-pre) and so should this!
+
+!! html/parsoid
+
This
+
+ and this should be part of same paragraph (not an indent-pre)
+
+ and so should this!
+!! end
+
+## Parsoid will not try to wt2wt this while preserving newlines because
+## it suppresses excess newlines within list items -- and we don't want to
+## introduce a special case just for categories, which is, in reality somewhat
+## odd behavior -- categories are unlikely to be used in list items like this
+## in top-level pages and are only likely to show up in template-generated
+## list items where this RT-ing is a non-issue.
+##
+## The whitespace on the empty line is part of the test. Please do not delete
+!! test
+2. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87)
+!! options
+parsoid=wt2html
+!! wikitext
+* This
+
+[[Category:Foo]] and this should be part of the same list item
+* So should this
+
+{{echo|[[Category:Foo]] and this should be part of the same list item}}
+!! html
+
This and this should be part of the same list item
+
So should this and this should be part of the same list item
+!! html/parsoid
+
+
This and this should be part of the same list item
+
So should this and this should be part of the same list item
+
+!! end
+
+## Newlines and categories that follow the last item of a list
+## are treated differently because this (list followed by categories)
+## is an extremely common pattern on wikis.
+!! test
+3. Categories and newlines: newline suppression for last list item should RT properly
+!! wikitext
+* a
+* b
+
+[[Category:Foo]]
+
+[[Category:Bar]]
+[[Category:Baz]]
+!! html/parsoid
+
a
+
b
+
+
+
+
+
+!! end
+
+!! test
+4. Categories and newlines: newline suppression for last list item should RT properly
+!! wikitext
+* a
+**** b
+
+[[Category:Foo]]
+!! html/parsoid
+
a
+
b
+
+
+!! end
+
+## only wt2html for this to make sure the algo only applies to the rightmost path
+!! test
+5. Categories and newlines: migrateTrailingCategories dom pass should only run on the rightmost path of nested lists
+!! options
+parsoid=wt2html
+!! wikitext
+* a
+** b
+[[Category:Foo]]
+* c
+** d
+[[Category:Foo]]
+!! html/parsoid
+
a
+
b
+
+
c
+
d
+
+!! end
+
+!! test
+6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines
+!! wikitext
+* a [[Category:Foo]]
+!! html/parsoid
+
a
+!! end
+
+# This test also demonstrates because of newline+category tunneling
+# through the list hander, template wrapping doesn't expand to the
+# containing list when the list item swallows the category.
+!! test
+7. Categories and newlines: migrateTrailingCategories dom pass should leave template content alone
+!! wikitext
+* {{echo|a
+[[Category:Foo]]}}
+!! html/parsoid
+
a
+
+!! end
+
+!! test
+8. Categories and newlines: migrateTrailingCategories dom pass should not get tripped by intervening templates
+!! wikitext
+* a
+
+{{echo|[[Category:Foo]]
+[[Category:Bar]]}}
+[[Category:Baz]]
+!! html/parsoid
+
a
+
+
+
+
+!! end
+
!! test
Parsoid: Serialize link to category page with colon escape
!! options
@@ -13445,20 +14390,26 @@ parsoid
[[:Category:Foo|Bar]]
!! html
!! end
+# html2wt localizes the "Category" namespace.
+# XXX the element needs an empty data-parsoid attribute, or
+# else the html2html test fails because spaces are inserted.
!! test
-Parsoid: Link prefix/suffixes aren't applied to category links
+Link prefix/suffixes aren't applied to category links
!! options
parsoid=wt2html,wt2wt,html2html
language=is
!! wikitext
x[[Category:Foo]]y
-!! html
-
xy
+!! html/php
+
xy
+
+!! html/parsoid
+
xy
!! end
!! test
@@ -13484,15 +14435,15 @@ parsoid
[[Category:Foo]]
[[Category:Foo|Bar]]
!! html
-
-
+
+
!! end
!! test
Normalize hrefs properly before testing for invalid link targets (bug 70894)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
[[Category:Toxine bactérienne]]
@@ -13630,7 +14581,7 @@ __FORCETOC__
== Headline ==
== Headline 2 ==
== Headline ==
-!! html
+!! html/php
+
+!! end
+
!! test
TOC with wgMaxTocLevel=3 (bug 6204)
!! options
@@ -14376,11 +15343,8 @@ I always thought &xacute; was a cute letter.
!! end
-# TODO: generalize to PHP parser?
!! test
HTML5 tags
-!! options
-parsoid
!! wikitext
five
@@ -14388,7 +15352,8 @@ parsoid
!! html
five
-This highlighted text
+This highlighted text
+
!! end
!! test
@@ -14628,13 +15593,19 @@ Attribute test: unquoted but illegal value (hash)
!! end
+# Parsoid does not serialize to empty attribute syntax,
+# so wt2wt and html2wt cases are skipped
!! test
-Attribute test: no value
+Attribute test: no value (T54330)
+!! options
+parsoid=wt2html,html2html
!! wikitext
foo
-!! html
-
foo
+!! html/php
+
foo
+!! html/parsoid
+
foo
!! end
!! test
@@ -14932,6 +15903,7 @@ MSIE 6 CSS safety test: sup/sub script (bug 55332)
!! end
+# FIXME: Parsoid fails to sanitize this! See T58846.
!! test
Opera -o-link CSS
!! wikitext
@@ -15006,7 +15978,7 @@ CSS line continuation 2
!! wikitext
!! html
-
+
!! end
@@ -15063,7 +16035,7 @@ evil
-!! html
-
Table not started</td></tr></table>
-
+!! html/php+tidy
+
Table not started
+!! html/parsoid
+
Table not started
!! end
!! test
@@ -15360,7 +16336,7 @@ Sanitizer: Validating that and work, but only for Microdata
!! html
-
+
<meta http-equiv="refresh" content="5">
@@ -16112,7 +17088,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
!! end
@@ -16132,7 +17108,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==a==
===aa===
====aaa====
@@ -16154,7 +17130,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===aa===
====aaa====
!! end
@@ -16175,7 +17151,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
====aaa====
!! end
@@ -16195,7 +17171,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==b==
===ba===
===bb===
@@ -16219,7 +17195,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===ba===
!! end
@@ -16239,7 +17215,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===bb===
====bba====
!! end
@@ -16260,7 +17236,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
====bba====
!! end
@@ -16280,7 +17256,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===bc===
!! end
@@ -16300,7 +17276,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==c==
===ca===
!! end
@@ -16321,7 +17297,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===ca===
!! end
@@ -16341,7 +17317,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
!! end
!! test
@@ -16352,7 +17328,7 @@ section=1
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==a==
==bogus== not a legal section
!! end
@@ -16365,7 +17341,7 @@ section=2
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==b==
!! end
@@ -16377,7 +17353,7 @@ section=1
==a==
==b==
==c==
-!! html
+!! html/php
==a==
!! end
@@ -16389,7 +17365,7 @@ section=2
==a==
==b==
==c==
-!! html
+!! html/php
==b==
!! end
@@ -16401,7 +17377,7 @@ section=1
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==a==
==bogus== not a legal section
!! end
@@ -16414,11 +17390,10 @@ section=2
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==b==
!! end
-
# Formerly testing for bug 2587, now resolved by the use of unmarked sections
# instead of respecting commented sections
!! test
@@ -16428,7 +17403,7 @@ section=1
!! wikitext
==sec1==
==sec2==
-!! html
+!! html/php
==sec2==
!!end
@@ -16439,11 +17414,10 @@ section=2
!! wikitext
==sec1==
==sec2==
-!! html
+!! html/php
!!end
-
# Formerly testing for bug 2607, now resolved by the use of unmarked sections
# instead of respecting HTML-style headings
!! test
@@ -16457,7 +17431,7 @@ unmarked
one
==2==
two
-!! html
+!! html/php
==1==
one
!! end
@@ -16473,7 +17447,7 @@ unmarked
one
==2==
two
-!! html
+!! html/php
==2==
two
!! end
@@ -16487,7 +17461,7 @@ section=1
!! wikitext
==unmarked==
==marked==
-!! html
+!! html/php
==marked==
!!end
@@ -16502,7 +17476,7 @@ The line above must have a trailing space
===
But just in case it doesn't...
-!! html
+!! html/php
===
But just in case it doesn't...
@@ -16524,7 +17498,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
xxx
==a==
@@ -16555,7 +17529,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
xxx
@@ -16584,7 +17558,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
xxx
@@ -16614,7 +17588,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16645,7 +17619,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16672,7 +17646,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16703,7 +17677,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16733,7 +17707,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16764,7 +17738,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16795,7 +17769,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16824,7 +17798,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -16846,7 +17820,7 @@ replace=2,"xxx"
Preformatted initial line
==a==
===a===
-!! html
+!! html/php
Preformatted initial line
==a==
xxx
@@ -16860,7 +17834,7 @@ section=1
!! wikitext
==a==
a
-!! html
+!! html/php
==a==
a
!! end
@@ -16872,7 +17846,7 @@ section=1
!! wikitext
==a==
a
-!! html
+!! html/php
==a==
a
!! end
@@ -16890,7 +17864,7 @@ noxml section=2
== Section Two ==
stuff
-!! html
+!! html/php
== Section Two ==
stuff
!! end
@@ -16907,7 +17881,7 @@ noxml replace=2,"xxx"
== Section Two ==
stuff
-!! html
+!! html/php
== Section One ==
=======
@@ -16917,7 +17891,6 @@ xxx
!! end
-
!! test
Handling of
in URLs
!! wikitext
@@ -17338,12 +18311,44 @@ parsoid=wt2html,wt2wt,html2html
îî
!! end
+# See: http://www.w3.org/TR/html5/syntax.html#character-references
+# Note that U+000C (form feed) is not a valid XML character, so
+# it is banned even though allowed in HTML5.
+!! test
+Illegal character references (T106578)
+!! wikitext
+; Null:
+; FF:
+; CR:
+; Control (low):
+; Control (high):
+; Surrogate:
+; This is an okay astral character: 💩
+!! html+tidy
+
+
Null
+
�
+
FF
+

+
CR
+

+
Control (low)
+

+
Control (high)
+
 Ÿ
+
Surrogate
+
��
+
This is an okay astral character
+
💩
+
+!! end
+
!! test
__FORCETOC__ override
!! wikitext
__NEWSECTIONLINK__
__FORCETOC__
-!! html
+!! html/php
!! end
@@ -17358,7 +18363,7 @@ ISBN 978-0-1234-56 789
!! html+tidy
!! end
+# Uppercase X and lowercase x as well
!! test
ISBN with an X
!! wikitext
ISBN 3-462-04561-X
+ISBN 3-462-04561-x
ISBN 080442957X
+ISBN 080442957x
ISBN 978080442957X
+ISBN 978080442957x
!! html/php
!! html/parsoid
-An external URL
+An external URL
!! end
!! test
@@ -17704,7 +18719,7 @@ Don't fall for the self-closing div
MSGNW magic word
!! wikitext
{{MSGNW:msg}}
-!! html
+!! html/php
[[:Template:Msg]]
!! end
@@ -18293,6 +19308,61 @@ Raw: -{R|zh:China;zh-tw:Taiwan}-
!! end
+!! test
+Strings evaluating false shouldn't be ignored by Language converter (T51072)
+!! options
+language=zh variant=zh-cn
+!! input
+-{zh-cn:0;zh-sg:1;zh-tw:2;zh-hk:3}-
+!! result
+
0
+
+!! end
+
+!! test
+Conversion rules from [numeric-only string] to [something else] (T48634)
+!! options
+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
+
D12345EE12345
+
+!! end
+
+!! test
+Bidirectional 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
+
foobar
+
+!! end
+
+!! test
+Unidirectional 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
+
foobar
+
+!! end
+
+!! test
+Empty converter rule entries shouldn't be inserted into the conversion table (T53551)
+!! options
+language=zh variant=zh-cn
+!! input
+-{H|}-foobar
+!! result
+
foobar
+
+!! end
+
!! test
Nested using of manual convert syntax
!! options
@@ -19038,7 +20108,7 @@ percent-encoding and + signs in comments (Bug 26410)
comment
!! wikitext
[[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
-!! html
+!! html/php
ABC3D% +++%20
!! end
@@ -19082,7 +20152,7 @@ wgAllowDisplayTitle=true
wgRestrictDisplayTitle=false
!! wikitext
this is not the the title
-!! html
+!! html/php
Parser test
this is not the the title
@@ -19099,7 +20169,7 @@ wgRestrictDisplayTitle=false
!! wikitext
this is not the the title
{{DISPLAYTITLE:whatever}}
-!! html
+!! html/php
whatever
this is not the the title
@@ -19116,7 +20186,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:whatever}}
-!! html
+!! html/php
Screen
this is not the the title
@@ -19133,7 +20203,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19149,7 +20219,7 @@ wgAllowDisplayTitle=false
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
Screen
this is not the the title
Template:DISPLAYTITLE:screen
@@ -19165,7 +20235,7 @@ title=[[Screen]]
wgAllowDisplayTitle=false
!! wikitext
this is not the the title
-!! html
+!! html/php
Screen
this is not the the title
@@ -19182,7 +20252,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19199,7 +20269,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19224,7 +20294,7 @@ Page status indicators: Weird syntaxes that are okay
showindicators
!! wikitext
-
+
!! html
empty=
name=
@@ -19287,7 +20357,7 @@ preload: check and
preload
!! wikitext
Hello cruelkind world.
-!! html
+!! html/php
Hello kind world.
!! end
@@ -19297,7 +20367,7 @@ preload: check
preload
!! wikitext
Goodbye Hello world
-!! html
+!! html/php
Hello world
!! end
@@ -19307,7 +20377,7 @@ preload: can pass tags through if we want to
preload
!! wikitext
<includeonly>Hello world</includeonly>
-!! html
+!! html/php
Hello world
!! end
@@ -19317,7 +20387,7 @@ preload: check that it doesn't try to do tricks
preload
!! wikitext
* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
-!! html
+!! html/php
* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
!! end
@@ -19368,7 +20438,10 @@ percent-encoding and + signs in internal links (Bug 26410)
3E3E+
!! html/parsoid
-
!! end
+# Don't expect Parsoid to roundtrip this until the php parser comes closer to
+# html5 tag parsing.
!! test
Tags with parameters in TOC
+!! options
+parsoid=wt2html
!! wikitext
__TOC__
== Hello ==
== Evilbye ==
-!! html
+!! html/php
-
+
+!! end
+
+!! test
+3. Bad treebuilder fixup of formatting elt is cleaned up
+!! options
+parsoid=wt2html,wt2wt
+!! wikitext
+'''foo[[File:Foobar.jpg|thumb|caption]]bar'''
+!! html/parsoid
+
foo
+caption
+
bar
+!! end
+
+!! test
+4. Bad treebuilder fixup of formatting elt is cleaned up: formatting tags around captionless images are ignored
+!! options
+parsoid=wt2html,wt2wt
+!! wikitext
+'''[[Image:Foobar.jpg|right|300px]]'''
+!! html/parsoid
+
+
+
!! end
#### ----------------------------------------------------------------
@@ -20159,13 +21268,13 @@ B foo
C
!! html
-
!!end
!!test
References: 1. references tag without any refs should be handled properly
-!!options
-parsoid
!! wikitext
-!! html
-
+!! html/parsoid
+
!!end
!!test
References: 2. references tag with group only outputs references from that group
-!!options
-parsoid
!! wikitext
A foo
B bar
@@ -20543,26 +21646,24 @@ C baz
-!! html
-
!!end
!!test
References: 3. ref list should be cleared after processing references
-!!options
-parsoid
!! wikitext
A foo
@@ -20571,23 +21672,21 @@ A foo
B bar
-!! html
-
!!end
!!test
References: 4. only referenced group should be cleared after processing references
-!!options
-parsoid
!! wikitext
A afoo
B bfoo
@@ -20597,23 +21696,21 @@ B bfoo
C cfoo
-!! html
-
!!end
!!test
References: 5. ref tags in references should be processed while ignoring all other content
-!!options
-parsoid
!! wikitext
A
B bar
@@ -20622,30 +21719,26 @@ B barfoo
This should just get lost.
-!! html
-
!!end
!! test
References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled
-!! options
-parsoid
!! wikitext
A foo bar for a
B
@@ -20655,30 +21748,28 @@ B foo
-!! html
-
!! end
!! test
References: 8. T88019: Remove s from templates inside that's itself inside a template
-!! options
-parsoid
!! wikitext
X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}}
-!! html
-
!!end
@@ -20688,18 +21779,16 @@ X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}}
# wt2wt.
!! test
References: 9. Generate missing references list at the end
-!! options
-parsoid
!! wikitext
A foo
B bar
-!! html
-
!! end
!! test
@@ -20756,8 +21843,8 @@ parsoid=wt2wt,html2wt
!! wikitext
foo
-!! html
-foo
+!! html/parsoid
+foo
!! end
#### ----------------------------------------------------------------
@@ -20864,23 +21951,23 @@ Empty TR nodes should not be stripped if they have any attributes set
!! test
Headings: 0. Unnested
!! options
-parsoid
+parsoid=html2wt
+!! html/parsoid
+
!!end
!! test
Headings: 6d. Heading chars in SOL context (with interspersed comments)
!! options
-parsoid
+parsoid=html2wt
+!! html/parsoid
+
=a=
+
+
=a=
!! wikitext
=a==a=
-!! html
-
=a=
-
=a=
!!end
!! test
Headings: 6d. Heading chars in SOL context (No escaping needed)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
=a=
b
!! wikitext
=a=
b
@@ -21099,11 +22189,11 @@ parsoid=html2wt
Headings: 7. Insert a newline between new content and headings
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
NEW
new
-
A
-
a
+
A
+
a
!! wikitext
== NEW ==
new
@@ -21126,23 +22216,38 @@ a
!! test
Lists: 0. Outside nests
+!! options
+parsoid=html2wt
+!! html/parsoid
+
*foo
+
+
#foo
+
+
;Foo:bar
!! wikitext
*foo
#foo
-;Foo:bar
-!! html
-
*foo
-
#foo
-
;Foo:bar
-
+;Foo:bar
!!end
!! test
Lists: 1. Nested inside html
-!! wikitext
-**foo
+!! options
+parsoid=html2wt
+!! html/parsoid
+
*foo
+
#foo
+
:foo
+
;foo
+
*foo
+
#foo
+
:foo
+
;foo
+
+!! wikitext
+**foo
*#foo
@@ -21157,20 +22262,19 @@ Lists: 1. Nested inside html
#:foo
#;foo
-!! html
-
*This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs
+|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.
+!! wikitext
+*This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs
+|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.
!! end
!! test
-Tables: Digest broken attributes on table and tr tag
+Unclosed xmlish element in table line shouldn't eat end delimiters
!! options
-parsoid=wt2html
+parsoid=html2wt
+!! html/parsoid
+
!! end
!! test
Links 6. Add s between text-nodes and url-links when required (bug 64300)
-!! html/parsoid
+!! options
+parsoid=html2wt
+!! html/parsoid
xhttp://example.comy
http://example.com?x
http://example.com&x
@@ -21805,6 +22950,8 @@ http://example.com(x)
!! test
Links 7a. Don't add spurious s between text-nodes and url-links (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
x
http://example.com
@@ -21838,6 +22985,8 @@ y
!! test
Links 7b. Don't add spurious s between text-nodes and url-links (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
@@ -21852,6 +23001,8 @@ http://example.com.,;:!?\
!! test
Links 8. Add s between text-nodes and RFC-links when required (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
RFC 1234
RFC 123y
@@ -21864,6 +23015,8 @@ XRFC 123y
!! test
Links 9. Don't add spurious s between text-nodes and RFC-links (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
RFC 123?foo
RFC 123&foo
@@ -21882,6 +23035,8 @@ RFC 123&foo
!! test
Links 10. Add s between text-nodes and PMID-links when required (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
PMID 1234
PMID 123y
@@ -21894,6 +23049,8 @@ XPMID 123y
!! test
Links 11. Don't add spurious s between text-nodes and PMID-links (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
PMID 123?foo
PMID 123&foo
@@ -21912,10 +23069,12 @@ PMID 123&foo
!! test
Links 12. Add s between text-nodes and ISBN-links when required (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
-
!! wikitext
-this is not a link: http://example.com
+this is not a link: http://example.com
!! end
!! test
Links 15. Link trails can't become link prefixes.
!! options
language=is
+parsoid=html2wt
+!! html/parsoid
+
'foo'''foo''
@@ -22011,12 +23152,44 @@ a|!*#-:;+-~[]{}b'''x''
'foo bar 'baz
a|!*#-:;+-~[]{}b'x
+!! wikitext
+'''foo'''
+''''foo''''
+'''''foo'''''
+''foo'''s
+''''foo''''
+'''''foo'''''
+''''''foo''''''
+'''foo'''bar'''baz'''
+'''foo''''s
+'''foo''
+''foo'''
+''foo''''
+'''foo'''
+''''foo'''
+'''foo''''
+''''foo''''
+''fools' errand''
+''fool's errand''
+'''foo'' bar '''baz''
+a|!*#-:;+-~[]{}b'''x''
!! end
!! test
1b. Quotes inside and with other tags on same line
!! options
-parsoid=html2wt,wt2wt
+parsoid=html2wt
+!! html/parsoid
+'a foo bar
+a' foo bar
+a' foo bar
+foo x'bar
+'foo[1]
+'foo
-
!! end
!! test
2. Link fragments separated by and tags
+!! options
+parsoid=html2wt
+!! html/parsoid
+
[[foohello]]
+
[[foohello]]
!! wikitext
[[''foo''hello]]
[['''foo'''hello]]
-!! html
-
[[foohello]]
-
[[foohello]]
-
!! end
# FIXME: Escaping one or both of [[ and ]] is also acceptable --
# this is one of the shortcomings of this format
!! test
3. Link fragments inside and
+!! options
+parsoid=html2wt
+!! html/parsoid
+
[[foo]]
+
[[foo]]
!! wikitext
''[[foo'']]
'''[[foo''']]
-!! html
-
[[foo]]
-
[[foo]]
-
!! end
!! test
4. No escaping needed
-!! wikitext
-'''bar'''
-''''bar''''
-'a:b'foo
-!! html
+!! options
+options=html2wt
+!! html/parsoid
'bar'
'bar'
'a:b'foo
+!! wikitext
+'''bar'''
+''''bar''''
+'a:b'foo
!! end
#### ----------- Paragraphs ---------------
@@ -22084,6 +23250,15 @@ parsoid=html2wt,wt2wt
!! test
1. No unnecessary escapes
+!! options
+parsoid=html2wt
+!! html/parsoid
+
bar [[foo]]
+
=bar [[foo]]
+
[[bar [[foo]]
+
]]bar [[foo]]
+
=bar foo]]=
+
!! wikitext
bar [[foo]]
@@ -22094,13 +23269,6 @@ bar [[foo]]
]]bar [[foo]]
=bar foo]]=
-!! html
-
bar [[foo]]
-
=bar [[foo]]
-
[[bar [[foo]]
-
]]bar [[foo]]
-
=bar foo]]=
-
!!end
#### ----------------------- PRE --------------------------
@@ -22109,101 +23277,136 @@ bar [[foo]]
!! test
1. Leading whitespace in SOL context should be escaped
!! options
-parsoid
+parsoid=html2wt
+!! html/parsoid
+
a
+
+
a
+
+
a(tab)
+
+
a
+
+ a
+
+
a
+ b
+
+
a
+ b
+
+
a
+ b
!! wikitext
a
a
-a(tab)
+ a(tab)
a
- a
+a
a
b
a
-b
+ b
a
- b
-!! html
-
a
-
a
-
a(tab)
-
a
-
a
-
a
- b
-
a
- b
-
a
- b
+ b
+!! html/php
+
a
+
a
+
a(tab)
+
a
+ a
+
a
+ b
+
a
+ b
+
a
+ b
+
!! end
!! test
2. Leading whitespace in non-indent-pre contexts should not be escaped
!! options
-parsoid
+parsoid=htm2wt
+!! html/parsoid
+
-
!! end
!! test
3. Leading whitespace in indent-pre suppressing contexts should not be escaped
!! options
-parsoid
-!! wikitext
+parsoid=html2wt
+!! html/parsoid
+
a
b
- c
+ c
-!! html
+!! wikitext
-
a
b
- c
+ c
!! end
!! test
4. Leading whitespace in indent-pre suppressing contexts should not be escaped
!! options
-parsoid
+options=html2wt
+!! html/parsoid
+ caption
!! wikitext
[[File:Foobar.jpg|thumb|caption]]
-!! html/parsoid
- caption
!! end
!! test
5. Nowiki escaping should account for indent-pres
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
==foo==
!! wikitext
==foo==
!! end
+!!test
+T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+* foo
+* bar
+
+!! wikitext
+ * foo
+ * bar
+!! end
+
#### --------------- Behavior Switches --------------------
+
!! test
1. Valid behavior switches should be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOC__
__TOC__
!! wikitext
@@ -22215,7 +23418,7 @@ __TOC__
2. Invalid behavior switches should not be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOO__
__|__
!! wikitext
@@ -22223,6 +23426,31 @@ __TOO__
__|__
!! end
+# We use indent-pre as an indirect way to test for sol-transparent behavior.
+!! test
+Behavior switches should be SOL-transparent
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+
+
+
__TOO__
+
+
foo
+
+
bar
+!! wikitext
+ __TOC__
+
+
+ __TOO__
+
+ __TOC__ foo
+
+__TOC__ bar
+!! end
+
#### --------------- HTML tags ---------------
#### 1. a tags
#### 2. other tags
@@ -22232,75 +23460,85 @@ __|__
!! test
1. a tags
!! options
-parsoid
+parsoid=html2wt
+!! html/parsoid
+<a href="http://google.com">google</a>
!! wikitext
google
-!! html
-<a href="http://google.com">google</a>
!! end
!! test
2. other tags
-!! wikitext
-*
foo
-*
foo
-*
-!! html
+!! options
+parsoid=html2wt
+!! html/parsoid
<div>foo</div>
<div style="color:red">foo</div>
<td>
+!! wikitext
+*
foo
+*
foo
+*
!! end
!! test
3. multi-line html tag
-!! wikitext
-
foo
-!! html
+!! options
+parsoid=html2wt
+!! html/parsoid
<div
>foo</div
>
+!! wikitext
+
foo
!! end
!! test
4. extension tags
+!! options
+parsoid=html2wt
+!! html/parsoid
+
<ref>foo</ref>
+
<ref>bar
+
baz</ref>
+
!! wikitext
foobar
baz
-!! html
-
<ref>foo</ref>
-
<ref>bar
-
baz</ref>
-
!! end
#### --------------- Others ---------------
!! test
Escaping nowikis
-!! wikitext
-<nowiki>foo</nowiki>
-!! html
+!! options
+parsoid=html2wt
+!! html/parsoid
<nowiki>foo</nowiki>
+!! wikitext
+<nowiki>foo</nowiki>
!! end
## The quote-char in the input is necessary for triggering the bug
!! test
(Bug 52035) Nowiki-escaping should not get tripped by " :" in text
!! options
-parsoid=wt2wt,html2wt
+parsoid=html2wt
+!! html/parsoid
+
foo's bar :
!! wikitext
foo's bar :
-!! html
-
foo's bar :
!! end
+#----------- End of wikitext escaping tests --------------
+
!! test
Tag-like HTML structures are passed through as text
@@ -22352,20 +23590,9 @@ HTML tag with broken attribute value quoting
!! wikitext
Foo
-!! end
-
-!! test
-Parsoid-only: HTML tag with broken attribute value quoting
-!! options
-parsoid
-!! wikitext
-Foo
!! end
@@ -22379,7 +23606,7 @@ Table with broken attribute value quoting
!! html/php
-
Foo
+
Foo
!! html/parsoid
@@ -22400,9 +23627,9 @@ Table with broken attribute value quoting on consecutive lines
!! html/php
-
Foo
+
Foo
-
Bar
+
Bar
!! html/parsoid
@@ -22415,7 +23642,7 @@ Table with broken attribute value quoting on consecutive lines
!! end
!! test
-Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353)
+2. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353)
!! options
parsoid
!! wikitext
@@ -22425,7 +23652,7 @@ parsoid
!! end
!! test
-Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353)
+1. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353)
!! options
parsoid
!! wikitext
@@ -22544,6 +23771,8 @@ bar
!!end
+# Note that the "style" attribute is really a template parameter here.
+# The = would have to be {{=}} if you wanted the literal.
!!test
Empty TD followed by TD with tpl-generated attribute
!! wikitext
@@ -22704,7 +23933,7 @@ Multi-line image caption generated by templates with/without trailing newlines
New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
new para
new heading
@@ -22721,12 +23950,10 @@ new para
## a Parsoid serializer test, marking this Parsoid only
!!test
Improperly nested inline or quotes tags with whitespace in between
-!!options
-parsoid
!! wikitext
x
''' ''x''' ''
-!! html
+!! html/parsoid
!!end
@@ -22752,7 +23977,7 @@ Ensure ParagraphWrapper can deal with stray closing pre tags
parsoid=wt2html
!! wikitext
plain text
-!! html
+!! html/parsoid
plain text
!!end
@@ -22762,7 +23987,7 @@ plain text
parsoid=wt2html
!! wikitext
hi
ho
-!! html
+!! html/parsoid
hi
ho
@@ -22778,7 +24003,7 @@ parsoid=wt2html,wt2wt
|| ||
a
-!! html
+!! html/parsoid
|| ||
a
@@ -22791,7 +24016,7 @@ Encapsulation properly handles null DSR information from foster box
parsoid=wt2html,wt2wt
!! wikitext
{{echo|
!!end
+# Note that the wt is broken on purpose: the = should be {{=}} if you
+# don't want it to be a template parameter key.
!!test
8. Encapsulate foster-parented transclusion content
!!options
@@ -22936,8 +24163,11 @@ parsoid=wt2wt,wt2html
|-
|b
|}
-!! html
-