X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=ffa435c08b55313e3ce23d1c27546b54e8a6ee5f;hb=ee734d0d3c7533bd9a690dbd71f5151da55c32ad;hp=766db1ea9622d510159685d1bf221f6385c87939;hpb=77594dc2bafa925506c0916ba8b226cf6beb2a92;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 766db1ea96..c8c63f397b 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -160,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
@@ -822,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
@@ -1314,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 (
@@ -1325,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
@@ -1363,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
@@ -1378,7 +1397,7 @@ sed abit.
:and a colon
-!! html
+!! html/php
Lorem ipsum dolor
sed abit.
@@ -1387,6 +1406,14 @@ sed abit.
:and a colon
+!! html/parsoid
+
Lorem ipsum dolor
+
+sed abit.
+ sed nullum.
+
+:and a colon
+
!! end
!! test
@@ -1400,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.
@@ -1408,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
@@ -1421,11 +1457,11 @@ Entities inside
!! test
Entities inside template parameters
-!! options
-parsoid
!! wikitext
{{echo|–}}
-!! html
+!! html/php+tidy
+
â
+!! html/parsoid
–
!! end
@@ -1433,17 +1469,17 @@ 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
+!! html/parsoid
<h2>foo</h2>
!! wikitext
foo
@@ -1453,7 +1489,7 @@ parsoid=html2wt
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''
@@ -1468,7 +1504,7 @@ This text: L'''[[Foo]]''
T71950: 2. Put nowiki as close to cause as possible, after ' :'
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -1977,7 +2017,7 @@ a [[Category:A1]] [[Category:A2]]
[[Category:A4]]
!! html/parsoid
a
-
+
!! end
!! test
@@ -1987,7 +2027,7 @@ parsoid=wt2html
!! wikitext
[[Category:A1]]a
!! html/parsoid
-
a
+
a
!! end
###
@@ -2017,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
@@ -2223,7 +2278,7 @@ Entities inside
-!! html
+!! html/php
<nowiki>
@@ -2236,6 +2291,18 @@ Entities inside
</pre>
+!! html/parsoid
+
<nowiki>
+
+
</nowiki>
+</pre>
+
+
+<pre>
+<nowiki>
+</pre>
+
+</pre>
!! end
!! test
@@ -2292,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
@@ -2421,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
@@ -2460,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
@@ -2666,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
+
@@ -2703,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
!! test
@@ -5223,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
bar
@@ -5980,12 +6250,19 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c
title="foo|" bar
+!! html/parsoid
+
+
bar
+
bar
+
title="foo|" bar
+
!! end
-# The "|}" to close the table is missing from the input, so parsoid's
-# *2wt modes will fail.
+# 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 (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
+Table security: embedded pipes
!! options
parsoid=wt2html,html2html
!! wikitext
@@ -6003,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
@@ -6022,7 +6301,7 @@ parsoid=wt2html,html2html
!! html/parsoid
-
foo
+
style="color: red !important;" data-contrived="put this here
foo
!! end
@@ -6157,6 +6436,21 @@ Indented table markup mixed with indented pre content (proposed in bug 6200)
!! 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
@@ -6570,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
@@ -6590,7 +6884,7 @@ parsoid=html2wt
Parsoid: newline inducing block nodes don't suppress
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a
foo
!! wikitext
a
@@ -6624,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
@@ -6637,7 +6928,7 @@ parsoid=wt2html
foo
|}
!!html/php+tidy
-
+
foo
@@ -6652,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
@@ -6862,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
@@ -6961,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
!! wikitext
[[MemoryAlpha:AlphaTest]]
@@ -7149,10 +7459,10 @@ Broken image links with HTML captions (bug 39700)
abc
!! html/parsoid
-
-
-
-
+
+
+
+
!! end
!! test
@@ -7469,7 +7779,7 @@ mótmælenda[[söfnuður|söfnuðir]]xxx
Parsoid link trail escaping
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
+mi:Template:Foo
!! end
###
@@ -8267,8 +8577,8 @@ Handling html with a br self-closing tag
!! html/php
-
-
+
+
@@ -9611,7 +9921,7 @@ parsoid=wt2wt,html2wt
foo
__NOTOC__
bar
-!! html
+!! html/parsoid
foobar
!! end
@@ -9622,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
###
@@ -9633,27 +9952,33 @@ __NOEDITSECTION__
Magic links: internal link to RFC (bug 479)
!! wikitext
[[RFC 123]]
-!! html
+!! html/php
!! end
###
@@ -10203,6 +10548,7 @@ Template:MSGNW test
File:Foobar.jpg
+
!! endarticle
# hmm, fix this or just deprecate msgnw and document its behavior?
@@ -10210,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
@@ -10218,6 +10564,7 @@ msgnw keyword
<gallery>
File:Foobar.jpg
</gallery>
+<!-- comment -->
!! end
@@ -10230,6 +10577,15 @@ int keyword
!! end
+!! test
+int keyword - non-existing message
+!! wikitext
+{{int:var}}
+!! html
+
<var>
+
+!! end
+
!! article
Template:Includes
!! text
@@ -10471,7 +10827,7 @@ b}}
!! end
!! test
-Parsoid: Merge double tds (bug 50603)
+Parsoid: Merge double tds (T52603)
!! options
parsoid
!! wikitext
@@ -10485,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
@@ -10998,6 +11354,25 @@ Templates: Support for templates generating attributes and content
!! 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
@@ -11462,41 +11837,40 @@ Parser Functions: 2. Nested use (only outermost should be marked up)
!! test
pre-save transform: subst:
!! options
-PST
+pst
!! wikitext
{{subst:test}}
-!! html
+!! html/php
This is a test template
!! end
!! test
pre-save transform: normal template
!! options
-PST
+pst
!! wikitext
{{test}}
-!! html
+!! html/php
{{test}}
!! end
!! test
pre-save transform: nonexistent template
!! options
-PST
+pst
!! wikitext
{{thistemplatedoesnotexist}}
-!! html
+!! html/php
{{thistemplatedoesnotexist}}
!! end
-
!! test
pre-save transform: subst magic variables
!! options
-PST
+pst
!! wikitext
{{subst:SITENAME}}
-!! html
+!! html/php
MediaWiki
!! end
@@ -11507,7 +11881,7 @@ pre-save transform: subst: templates with parameters
pst
!! wikitext
{{subst:paramtest|param="something else"}}
-!! html
+!! html/php
This is a test template with parameter "something else"
!! end
@@ -11523,11 +11897,10 @@ pre-save transform: nowiki in subst (bug 1188)
pst
!! wikitext
{{subst:nowikitest}}
-!! html
+!! html/php
'''not wiki'''
!! end
-
!! article
Template:commenttest
!! text
@@ -11540,7 +11913,7 @@ pre-save transform: comment in subst (bug 1936)
pst
!! wikitext
{{subst:commenttest}}
-!! html
+!! html/php
This template has in it.
!! end
@@ -11550,7 +11923,7 @@ pre-save transform: unclosed tag
pst noxml
!! wikitext
'''not wiki'''
-!! html
+!! html/php
'''not wiki'''
!! end
@@ -11560,7 +11933,7 @@ pre-save transform: mixed tag case
pst noxml
!! wikitext
'''not wiki'''
-!! html
+!! html/php
'''not wiki'''
!! end
@@ -11570,7 +11943,7 @@ pre-save transform: unclosed comment in
pst noxml
!! wikitext
wikinowiki
-!! html
+!! html/php
!!end
@@ -11608,7 +11981,7 @@ pre-save transform: comment containing extension
pst
!! wikitext
-!! html
+!! html/php
!!end
@@ -11618,7 +11991,7 @@ pre-save transform: comment containing nowiki
pst
!! wikitext
-!! html
+!! html/php
!!end
@@ -11628,7 +12001,7 @@ pre-save transform: in subst (bug 3298)
pst
!! wikitext
{{subst:Includes}}
-!! html
+!! html/php
Foobar
!! end
@@ -11638,7 +12011,7 @@ pre-save transform: in subst (bug 3298)
pst
!! wikitext
{{subst:Includes2}}
-!! html
+!! html/php
Foo
!! end
@@ -11660,7 +12033,7 @@ bug 22297: safesubst: works during PST
pst
!! wikitext
{{subst:SafeSubstTest}}{{safesubst:SubstTest}}
-!! html
+!! html/php
FoobarFoobar
!! end
@@ -11696,7 +12069,7 @@ pst
[[|Article (context)]]
[[Bar:X (Y) Z|]]
[[:Bar:X (Y) Z|]]
-!! html
+!! html/php
[[Article (context)|Article]]
[[Bar:Article|Article]]
[[:Bar:Article|Article]]
@@ -11717,7 +12090,7 @@ pst
[[:interwiki:Article|]]
[[interwiki:Bar:Article|]]
[[:interwiki:Bar:Article|]]
-!! html
+!! html/php
[[interwiki:Article|Article]]
[[:interwiki:Article|Article]]
[[interwiki:Bar:Article|Bar:Article]]
@@ -11730,7 +12103,7 @@ pre-save transform: context links ("pipe trick") with parens in title
pst title=[[Somearticle (context)]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Article (context)|Article]]
!! end
@@ -11742,7 +12115,7 @@ pst title=[[Someplace, Somewhere]]
[[|Otherplace]]
[[Otherplace, Elsewhere|]]
[[Otherplace, Elsewhere, Anywhere|]]
-!! html
+!! html/php
[[Otherplace, Somewhere|Otherplace]]
[[Otherplace, Elsewhere|Otherplace]]
[[Otherplace, Elsewhere, Anywhere|Otherplace]]
@@ -11755,7 +12128,7 @@ pst title=[[Someplace (IGNORED), Somewhere]]
!! wikitext
[[|Otherplace]]
[[Otherplace (place), Elsewhere|]]
-!! html
+!! html/php
[[Otherplace, Somewhere|Otherplace]]
[[Otherplace (place), Elsewhere|Otherplace]]
!! end
@@ -11767,7 +12140,7 @@ pst title=[[Who, me? (context)]]
!! wikitext
[[|Yes, you.]]
[[Me, Myself, and I (1937 song)|]]
-!! html
+!! html/php
[[Yes, you. (context)|Yes, you.]]
[[Me, Myself, and I (1937 song)|Me, Myself, and I]]
!! end
@@ -11778,7 +12151,7 @@ pre-save transform: context links ("pipe trick") with namespace
pst title=[[Ns:Somearticle]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Ns:Article|Article]]
!! end
@@ -11788,7 +12161,7 @@ pre-save transform: context links ("pipe trick") with namespace and parens
pst title=[[Ns:Somearticle (context)]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Ns:Article (context)|Article]]
!! end
@@ -11798,7 +12171,7 @@ pre-save transform: context links ("pipe trick") with namespace and comma
pst title=[[Ns:Somearticle, Context, Whatever]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Ns:Article, Context, Whatever|Article]]
!! end
@@ -11808,7 +12181,7 @@ pre-save transform: context links ("pipe trick") with namespace, comma and paren
pst title=[[Ns:Somearticle, Context (context)]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Ns:Article (context)|Article]]
!! end
@@ -11818,7 +12191,7 @@ pre-save transform: context links ("pipe trick") with namespace, parens and comm
pst title=[[Ns:Somearticle (IGNORED), Context]]
!! wikitext
[[|Article]]
-!! html
+!! html/php
[[Ns:Article, Context|Article]]
!! end
@@ -11833,7 +12206,7 @@ pst
[[|Articleï¼contextï¼]]
[[Bar:Xï¼Yï¼Z|]]
[[:Bar:Xï¼Yï¼Z|]]
-!! html
+!! html/php
[[Articleï¼contextï¼|Article]]
[[Bar:Articleï¼contextï¼|Article]]
[[:Bar:Articleï¼contextï¼|Article]]
@@ -11853,7 +12226,7 @@ pst
[[|Article ï¼contextï¼]]
[[Bar:X ï¼Yï¼ Z|]]
[[:Bar:X ï¼Yï¼ Z|]]
-!! html
+!! html/php
[[Article ï¼contextï¼|Article]]
[[Bar:Article ï¼contextï¼|Article]]
[[:Bar:Article ï¼contextï¼|Article]]
@@ -11873,7 +12246,7 @@ pst
[[|Article(context)]]
[[Bar:X(Y)Z|]]
[[:Bar:X(Y)Z|]]
-!! html
+!! html/php
[[Article(context)|Article]]
[[Bar:Article(context)|Article]]
[[:Bar:Article(context)|Article]]
@@ -11893,7 +12266,7 @@ pst
[[Bar:Article (context)ï¼context|]]
[[:Bar:Article (context), context|]]
[[:Bar:Article (context)ï¼context|]]
-!! html
+!! html/php
[[Article (context), context|Article]]
[[Article (context)ï¼context|Article]]
[[Bar:Article (context), context|Article]]
@@ -11912,7 +12285,7 @@ Empty lines are trimmed
-!! html
+!! html/php
Empty lines are trimmed
!! end
@@ -11925,7 +12298,7 @@ pst
* ~~~
* ~~~
* ~~~
-!! html
+!! html/php
* [[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]]
@@ -11956,7 +12329,7 @@ As well as inside noinclude/onlyinclude
But not inside includeonly
{{subst:Foo}}
-!! html
+!! html/php
Shall not expand:
~~~~
@@ -12011,7 +12384,7 @@ parsoid=wt2html
Parsoid: Escape nowiki with trailing space in tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
<noWikI > foo </NoWikI >
@@ -12468,6 +12841,21 @@ Image with link parameter, protocol-less URL target
!! end
+!! test
+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
@@ -12656,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]]
@@ -12667,8 +13053,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12749,7 +13135,7 @@ parsoid=wt2html,wt2wt,html2html
###################
# 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.
@@ -12906,7 +13292,7 @@ Frameless image caption with a free URL
!! html/parsoid
-
+
!! end
!! test
@@ -12982,7 +13368,7 @@ BUG 1887: A ISBN with a thumbnail
!! html/parsoid
-ISBN 1235467890
+ISBN 1235467890
!! end
!! test
@@ -13016,7 +13402,7 @@ BUG 648: Frameless image caption with a link
!! html/parsoid
-
+
!! end
!! test
@@ -13027,7 +13413,7 @@ BUG 648: Frameless image caption with a link (suffix)
!! html/parsoid
-
+
!! end
!! test
@@ -13038,7 +13424,7 @@ BUG 648: Frameless image caption with an interwiki link
!! html/parsoid
-
+
!! end
!! test
@@ -13049,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
@@ -13060,7 +13454,7 @@ Escape HTML special chars in image alt text
!! html/parsoid
-
+
!! end
!! test
@@ -13071,7 +13465,7 @@ BUG 499: Alt text should have Ӓ, not &1234;
!! html/parsoid
-
+
!! end
!! test
@@ -13398,7 +13792,7 @@ Parsoid-specific image handling - simple image with a formatted caption
!! wikitext
[[File:Foobar.jpg|
a
b
c
]]
!! html/parsoid
-
+
!! end
!! test
@@ -13472,6 +13866,42 @@ bar
bar
!! end
+## Edge case bugs in Parsoid from T93580
+!! test
+T93580: 1. Templated inside block images
+!! wikitext
+[[File:Foobar.jpg|thumb|Caption with templated ref: {{echo|foo}}]]
+
+
+!! html/parsoid
+Caption with templated ref: [1]
+
+
+This highlighted text
+
!! end
!! test
@@ -15165,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
@@ -15469,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
@@ -15543,7 +15978,7 @@ CSS line continuation 2
!! wikitext
!! html
-
+
!! end
@@ -15600,7 +16035,7 @@ evil
-!! html
-
Table not started</td></tr></table>
-
+!! html/php+tidy
+
Table not started
+!! html/parsoid
+
Table not started
!! end
!! test
@@ -15897,7 +16336,7 @@ Sanitizer: Validating that and work, but only for Microdata
!! html
-
+
<meta http-equiv="refresh" content="5">
@@ -16649,7 +17088,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
!! end
@@ -16669,7 +17108,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==a==
===aa===
====aaa====
@@ -16691,7 +17130,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===aa===
====aaa====
!! end
@@ -16712,7 +17151,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
====aaa====
!! end
@@ -16732,7 +17171,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==b==
===ba===
===bb===
@@ -16756,7 +17195,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===ba===
!! end
@@ -16776,7 +17215,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===bb===
====bba====
!! end
@@ -16797,7 +17236,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
====bba====
!! end
@@ -16817,7 +17256,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===bc===
!! end
@@ -16837,7 +17276,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
==c==
===ca===
!! end
@@ -16858,7 +17297,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
===ca===
!! end
@@ -16878,7 +17317,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
!! end
!! test
@@ -16889,7 +17328,7 @@ section=1
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==a==
==bogus== not a legal section
!! end
@@ -16902,7 +17341,7 @@ section=2
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==b==
!! end
@@ -16914,7 +17353,7 @@ section=1
==a==
==b==
==c==
-!! html
+!! html/php
==a==
!! end
@@ -16926,7 +17365,7 @@ section=2
==a==
==b==
==c==
-!! html
+!! html/php
==b==
!! end
@@ -16938,7 +17377,7 @@ section=1
==a==
==bogus== not a legal section
==b==
-!! html
+!! html/php
==a==
==bogus== not a legal section
!! end
@@ -16951,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
@@ -16965,7 +17403,7 @@ section=1
!! wikitext
==sec1==
==sec2==
-!! html
+!! html/php
==sec2==
!!end
@@ -16976,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
@@ -16994,7 +17431,7 @@ unmarked
one
==2==
two
-!! html
+!! html/php
==1==
one
!! end
@@ -17010,7 +17447,7 @@ unmarked
one
==2==
two
-!! html
+!! html/php
==2==
two
!! end
@@ -17024,7 +17461,7 @@ section=1
!! wikitext
==unmarked==
==marked==
-!! html
+!! html/php
==marked==
!!end
@@ -17039,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...
@@ -17061,7 +17498,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
xxx
==a==
@@ -17092,7 +17529,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
xxx
@@ -17121,7 +17558,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
xxx
@@ -17151,7 +17588,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17182,7 +17619,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17209,7 +17646,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17240,7 +17677,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17270,7 +17707,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17301,7 +17738,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17332,7 +17769,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17361,7 +17798,7 @@ start
===bc===
==c==
===ca===
-!! html
+!! html/php
start
==a==
===aa===
@@ -17383,7 +17820,7 @@ replace=2,"xxx"
Preformatted initial line
==a==
===a===
-!! html
+!! html/php
Preformatted initial line
==a==
xxx
@@ -17397,7 +17834,7 @@ section=1
!! wikitext
==a==
a
-!! html
+!! html/php
==a==
a
!! end
@@ -17409,7 +17846,7 @@ section=1
!! wikitext
==a==
a
-!! html
+!! html/php
==a==
a
!! end
@@ -17427,7 +17864,7 @@ noxml section=2
== Section Two ==
stuff
-!! html
+!! html/php
== Section Two ==
stuff
!! end
@@ -17444,7 +17881,7 @@ noxml replace=2,"xxx"
== Section Two ==
stuff
-!! html
+!! html/php
== Section One ==
=======
@@ -17454,7 +17891,6 @@ xxx
!! end
-
!! test
Handling of
in URLs
!! wikitext
@@ -17875,6 +18311,38 @@ 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
+
!! 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
!! end
!! test
@@ -18241,7 +18719,7 @@ Don't fall for the self-closing div
MSGNW magic word
!! wikitext
{{MSGNW:msg}}
-!! html
+!! html/php
[[:Template:Msg]]
!! end
@@ -19674,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
@@ -19691,7 +20169,7 @@ wgRestrictDisplayTitle=false
!! wikitext
this is not the the title
{{DISPLAYTITLE:whatever}}
-!! html
+!! html/php
whatever
this is not the the title
@@ -19708,7 +20186,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:whatever}}
-!! html
+!! html/php
Screen
this is not the the title
@@ -19725,7 +20203,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19741,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
@@ -19757,7 +20235,7 @@ title=[[Screen]]
wgAllowDisplayTitle=false
!! wikitext
this is not the the title
-!! html
+!! html/php
Screen
this is not the the title
@@ -19774,7 +20252,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19791,7 +20269,7 @@ wgRestrictDisplayTitle=true
!! wikitext
this is not the the title
{{DISPLAYTITLE:screen}}
-!! html
+!! html/php
screen
this is not the the title
@@ -19816,7 +20294,7 @@ Page status indicators: Weird syntaxes that are okay
showindicators
!! wikitext
-
+
!! html
empty=
name=
@@ -19879,7 +20357,7 @@ preload: check and
preload
!! wikitext
Hello cruelkind world.
-!! html
+!! html/php
Hello kind world.
!! end
@@ -19889,7 +20367,7 @@ preload: check
preload
!! wikitext
Goodbye Hello world
-!! html
+!! html/php
Hello world
!! end
@@ -19899,7 +20377,7 @@ preload: can pass tags through if we want to
preload
!! wikitext
<includeonly>Hello world</includeonly>
-!! html
+!! html/php
Hello world
!! end
@@ -19909,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
@@ -19962,7 +20440,7 @@ percent-encoding and + signs in internal links (Bug 26410)
!! 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
@@ -20741,6 +21228,30 @@ parsoid=wt2html,wt2wt
!! 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
+
#### ----------------------------------------------------------------
#### Parsoid-only testing of Parsoid's impl of and
#### tags. Parsoid's output for these tags differs from that of the
@@ -21440,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
@@ -21678,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
@@ -21705,21 +22216,36 @@ 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
+!! options
+parsoid=html2wt
+!! html/parsoid
+
*foo
+
#foo
+
:foo
+
;foo
+
*foo
+
#foo
+
:foo
+
;foo
+
!! wikitext
**foo
@@ -21736,20 +22262,19 @@ Lists: 1. Nested inside html
#:foo
#;foo
-!! html
-
!! end
!! test
-Tables: Digest broken attributes on table and tr tag
+T97430: Don't emit empty nowiki pairs around marker meta tags
!! options
-parsoid=wt2html
-!! wikitext
-{| || |} ++
-|- || || ++ --
-|- > [
-|}
-!! html
-
-
-
-
-
-!! end
-
-!! test
-T97430: Don't emit empty nowiki pairs around marker meta tags
-!! options
-parsoid=html2wt
-!! 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.
+parsoid=html2wt
+!! html/parsoid
+
*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.
+|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.
!! end
!! test
Unclosed xmlish element in table line shouldn't eat end delimiters
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+
<foo
+
bar>
+
!! wikitext
{|
| bar>
-!! html/parsoid
-
-
<foo
-
bar>
-
!! end
#### --------------- Links ----------------
@@ -22278,6 +22802,12 @@ Unclosed xmlish element in table line shouldn't eat end delimiters
#### --------------------------------------
!! test
Links 1. WikiLinks: No escapes needed
+!! options
+parsoid=html2wt
+!! html/parsoid
+
!! end
!! test
Links 6. Add s between text-nodes and url-links when required (bug 64300)
+!! options
+parsoid=html2wt
!! html/parsoid
xhttp://example.comy
http://example.com?x
@@ -22418,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
@@ -22451,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
@@ -22465,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
@@ -22477,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
@@ -22495,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
@@ -22507,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
@@ -22525,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'' and bar
+
!! 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 ---------------
@@ -22697,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]]
@@ -22707,13 +23269,6 @@ bar [[foo]]
]]bar [[foo]]
=bar foo]]=
-!! html
-
bar [[foo]]
-
=bar [[foo]]
-
[[bar [[foo]]
-
]]bar [[foo]]
-
=bar foo]]=
-
!!end
#### ----------------------- PRE --------------------------
@@ -22722,90 +23277,110 @@ 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
-!! wikitext
-foo ''a''
- b
-
-!! html
+parsoid=htm2wt
+!! html/parsoid
+!! wikitext
+foo ''a''
+ b
+
!! 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
-!! wikitext
- [[File:Foobar.jpg|thumb|caption]]
+options=html2wt
!! html/parsoid
caption
+!! wikitext
+ [[File:Foobar.jpg|thumb|caption]]
!! end
!! test
5. Nowiki escaping should account for indent-pres
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
==foo==
!! wikitext
==foo==
@@ -22814,15 +23389,15 @@ parsoid=html2wt
!!test
T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block
!! options
-parsoid
-!! wikitext
- * foo
- * bar
-!! html
+parsoid=html2wt
+!! html/parsoid
* foo
* bar
+!! wikitext
+ * foo
+ * bar
!! end
#### --------------- Behavior Switches --------------------
@@ -22831,7 +23406,7 @@ parsoid
1. Valid behavior switches should be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOC__
__TOC__
!! wikitext
@@ -22843,7 +23418,7 @@ __TOC__
2. Invalid behavior switches should not be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOO__
__|__
!! wikitext
@@ -22854,15 +23429,8 @@ __|__
# We use indent-pre as an indirect way to test for sol-transparent behavior.
!! test
Behavior switches should be SOL-transparent
-!! wikitext
- __TOC__
-
-
- __TOO__
-
- __TOC__ foo
-
-__TOC__ bar
+!! options
+parsoid=html2wt
!! html/parsoid
@@ -22872,6 +23440,15 @@ __TOC__ bar
foo
bar
+!! wikitext
+ __TOC__
+
+
+ __TOO__
+
+ __TOC__ foo
+
+__TOC__ bar
!! end
#### --------------- HTML tags ---------------
@@ -22883,75 +23460,85 @@ __TOC__ bar
!! 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
@@ -23003,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
@@ -23030,7 +23606,7 @@ Table with broken attribute value quoting
!! html/php
-
Foo
+
Foo
!! html/parsoid
@@ -23051,9 +23627,9 @@ Table with broken attribute value quoting on consecutive lines
!! html/php
-
Foo
+
Foo
-
Bar
+
Bar
!! html/parsoid
@@ -23066,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
@@ -23076,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
@@ -23386,9 +23962,9 @@ Improperly nested inline or quotes tags with whitespace in between
!!test
Encapsulate protected attributes from wt
!! wikitext
-
foo
+
foo
!! html/parsoid
-
foo
+
foo
!!end
@@ -23678,7 +24254,7 @@ Don't block XML namespace declaration
Serialize interwiki links pointing to the current wiki as plain wiki links (bug 65869)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
[[Foo]]
@@ -23689,7 +24265,7 @@ parsoid=html2wt
New wikilinks should be serialized properly
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
FooFoo
!! wikitext
@@ -23701,7 +24277,7 @@ parsoid=html2wt
New wiki links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo_barFoo_bar
@@ -23717,7 +24293,7 @@ parsoid=html2wt
New wiki links (content string variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo bar./Foo_bar
@@ -23731,7 +24307,7 @@ parsoid=html2wt
New category links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -23746,7 +24322,7 @@ New sol transparent links don't need indent-pre nowiki protection
!! options
parsoid=html2wt
language=de
-!! html
+!! html/parsoid
@@ -23760,7 +24336,7 @@ language=de
New interlanguage links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -23907,16 +24483,17 @@ parsoid
bar
!! end
-#!! test
-#Image: new attributes should be serialized in wiki's language for RTL languages (bug 51852)
-#!! options
-#parsoid=html2wt
-#language=ar
-#!! html
-#
-#!! wikitext
-#[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]]
-#!! end
+!! test
+Image: new attributes should be serialized in wiki's language for RTL languages (bug 51852)
+!! options
+parsoid=html2wt
+language=ar
+disabled
+!! html/parsoid
+
+!! wikitext
+[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]]
+!! end
!! test
Image: Block level image should have \n before and after
@@ -24008,7 +24585,7 @@ parsoid=html2wt
Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
@@ -24020,7 +24597,7 @@ parsoid=html2wt
Lists: Serialize correctly even when list tags has unneeded whitespace between tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
!! wikitext
* foo
@@ -24030,7 +24607,7 @@ parsoid=html2wt
Don't strip leading whitespace when handling indent-pre suppressing tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! end
@@ -24095,7 +24672,7 @@ foo
Lists: Dont insert newlines in a serialized list item.
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a b
c
!! wikitext
* a b
@@ -24103,17 +24680,49 @@ parsoid=html2wt
!! end
!! test
-Headings: Force sol-transparent links and behavior switches to serialize before/after
+1. Headings: Force sol-transparent links and behavior switches to serialize before/after
!! options
-parsoid=html2wt
-!! html
-
+!! wikitext
+== hello there [[Category:A1]] ==
+
+== [[Category:A2]] hi pal ==
+
+== [[Category:A3]] how goes it ==
+
+== it goes well [[Category:A4]] ==
-
how goes it
-
it goes well
+==howdy [[Category:A5]] ==
+
+== __TOC__ ok ==
+!! end
+
+!! test
+2. Headings: Force sol-transparent links and behavior switches to serialize before/after
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+
hello there
+
hi pal
-
howdy
+
how goes it
+
it goes well
ok
!! wikitext
@@ -24130,8 +24739,6 @@ parsoid=html2wt
== it goes well ==
[[Category:A4]]
-==howdy [[Category:A5]] ==
-
__TOC__
== ok ==
@@ -24140,8 +24747,11 @@ __TOC__
!! test
Headings: Don't hoist metas that come from templates
!! options
-parsoid=html2wt
-!! html
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
foo
!! wikitext
== {{echo|foo [[Category:Foo]]}} ==
@@ -24150,9 +24760,12 @@ parsoid=html2wt
!! test
Headings: Category in ref isn't hoisted
!! options
-parsoid=html2wt
-!! html
-
!! wikitext
@@ -24166,7 +24779,7 @@ parsoid=html2wt
Parsoid: Serialize positional parameters with = in them as named parameter
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
@@ -24190,7 +24803,7 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
Parsoid: Serialize positional parameters with = in extlink as named parameter
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
{{echo|1 = http://stuff?is=ok}}
@@ -24200,7 +24813,7 @@ parsoid=html2wt
Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a
b
a
b
@@ -24225,7 +24838,7 @@ b
Substrings resembling wikitext in hrefs should not get nowiki escapes
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo''bar''baz
!! wikitext
[[Foo''bar''baz]]
@@ -24235,14 +24848,14 @@ parsoid=html2wt
Enforce single-line context in the serializer
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
== testing 123 ==
@@ -24270,13 +24893,21 @@ there ==
* foo bar baz
* foo '''bar''' baz
+
+; hi ho : hi ho
+
+: {|
+| ha
+ha
+ha
+|}
!! end
!! test
Serialize new placeholder space without spans
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo : bar
foo : bar
@@ -24299,7 +24930,7 @@ foo : bar
1. I/B quote minimization: wikitext-only tags should be combined
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
AB
AB
@@ -24330,7 +24961,7 @@ parsoid=html2wt
2. I/B quote minimization: wikitext and html tags should not be combined
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
!! wikitext
@@ -24356,7 +24987,7 @@ parsoid=html2wt
4. I/B quote minimization: new content should be mimimized with adjacent old content
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
AB
AB
@@ -24405,7 +25036,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
FootballFootballFootball
@@ -24422,7 +25053,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|''Football'']]
@@ -24435,7 +25066,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": false
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|Foot]][[Football|ball]]
@@ -24449,10 +25080,10 @@ parsoid={
Bug 54262: New entities
!! options
parsoid=html2wt
+!! html/parsoid
+
!! wikitext
-!! html
-
!! end
## Note that there is no wikitext output for 'unknownproperty' ##
@@ -24489,7 +25120,7 @@ __NOCONTENTCONVERT__
Consecutive
s should not get merged
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
a
b
c
@@ -24521,8 +25152,8 @@ f
Edited ISBN links not serializable as ISBN links should serialize as wikilinks
!! options
parsoid=html2wt
-!! html
-ISBN 1234567895
+!! html/parsoid
+ISBN 1234567895
!! wikitext
[[Special:BookSources/1234567890|ISBN 1234567895]]
!! end
@@ -24531,7 +25162,7 @@ parsoid=html2wt
Edited RFC links not serializable as RFC links should serialize as extlinks
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
New RFC
!! wikitext
[//tools.ietf.org/html/rfc123 New RFC]
@@ -24541,7 +25172,7 @@ parsoid=html2wt
Edited PMID links not serializable as PMID links should serialize as extlinks
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
New PMID
!! wikitext
[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID]
@@ -24598,36 +25229,157 @@ xhttp://cscott.netx
!! end
!! test
-Edited Redirect link should emit a non-piped wikitext link
+WTS of edited autolink-like text (T103364)
!! options
-parsoid=html2wt
-!! html
-
+parsoid={
+ "modes": ["wt2wt"],
+ "changes": [
+ [ "span[typeof]", "removeAttr", "typeof" ]
+ ]
+}
!! wikitext
-#REDIRECT [[Bar]]
+Not a link: http://example.com.
+!! wikitext/edited
+Not a link: http://example.com.
!! end
!! test
-T75121: Infer extension name from typeOf if data-mw is not present
+WTS of newly-authored autolink-like text (T103364)
!! options
parsoid=html2wt
-!! html
-
+!! html/parsoid
+
http://example.com is not a link.
!! wikitext
-
+http://example.com is not a link.
!! end
-# Note that the
wrapping isn't present in PHP parser output
-# The important thing for this test is that P-wrapping doesn't
-# interfere with the protection for leading - in
-# (which isn't necessary for
).
!! test
-T88318: p-wrapped dash in table.
+WTS of autolink-like text after an autolink (T108563)
!! options
-parsoid=html2wt,wt2wt
+parsoid=html2wt
!! html/parsoid
-
+!! wikitext
+RFC 1234
+
+[http://foo.com RFC 1234]
+
+[[Foo|RFC 1234]]
+!! end
+
+!! test
+Edited Redirect link should emit a non-piped wikitext link
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! wikitext
+#REDIRECT [[Bar]]
+!! end
+
+!! test
+T75121: Infer extension name from typeOf if data-mw is not present
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! wikitext
+
+!! end
+
+# Note that the
wrapping isn't present in PHP parser output
+# The important thing for this test is that P-wrapping doesn't
+# interfere with the protection for leading - in
+# (which isn't necessary for
).
+!! test
+T88318: p-wrapped dash in table.
+!! options
+parsoid=html2wt,wt2wt
+!! html/parsoid
+
+
-
-
-
-
-
-
-
@@ -24671,7 +25423,7 @@ parsoid=html2wt,wt2wt
HTML id attribute with Parsoid-like element ids should not be serialized to wikitext
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
bar
@@ -24687,7 +25439,7 @@ parsoid=html2wt
Parsoid-like element ids should not be serialized to wikitext unless shadowed
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
ok
!! wikitext
ok
@@ -24714,7 +25466,7 @@ parsoid={
Never serialize a-tag as html, regardless of what data-parsoid has to say
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo
!! wikitext
[[Foo]]
@@ -24728,12 +25480,25 @@ parsoid=html2wt
Never serialize a-tag as html, no matter what attributes it has
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
[http://boo.org http://boohoo.org]
!! end
+# Misnested is an indication that selser can reuse the source but these have
+# shown to sneak through on occasion. See T101768.
+# The original wikitext here is: [http://test.com [[one]] two three]
+!! test
+Strip span tags added to mark as misnested
+!! options
+parsoid=html2wt
+!! html/parsoid
+
"]
+ ]
+}
+!! wikitext
+foo
+!! wikitext/edited
+foo
+
+x
+!! end
+
+!! test
+1. Indent Pre Nowiki: suppress whitespace at the start of new paragraph
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
hi
+
hello
!! wikitext
hi
+
+hello
!! end
!! test
2. Indent Pre Nowiki: don't suppress whitespace at the start of new paragraph if scrubWikitext is false
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
hi
+
hello
!! wikitext
hi
+
+ hello
+!! end
+
+!! test
+3. Indent Pre Nowiki: suppress whitespace after newlines in new paragraph or table cell
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+
Foo
+ bar
+baz
+
+
Foo
+ bar
+ baz bang
+
+
foo
+ bar
+
+
foo
+ barboo
+!! wikitext
+Foo
+bar
+baz
+
+{|
+|Foo
+bar
+baz bang
+|}
+
+foo
+bar
+
+foo
+barboo
+!! end
+
+!! test
+4. Indent Pre Nowiki: suppress leading whitespace in edited paragraphs
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "p", "html", " a\n b" ]
+ ]
+}
+!! wikitext
+xyz
+!! wikitext/edited
+a
+b
+!! end
+
+!! test
+1. New links that end in spaces
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": false
+}
+!! html/parsoid
+
+!! wikitext
+[[Berlin ]]is the capital of Germany.
+
+[[Foo ]]'''bar'''
+
+[[Boston ]] is a city.
+!! end
+
+!! test
+2. New links that end in spaces
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
+
+!! wikitext
+[[Berlin]] is the capital of Germany.
+
+[[Foo]] '''bar'''
+
+[[Boston]] is a city.
+!! end
+
+!! test
+1. Table cells with escapable prefixes
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": false
+}
+!! html
+
+
a
+
-
+
+
+
+!! wikitext
+{|
+|a
+|-
+|-
+|-
+|+
+|}
+!! end
+
+!! test
+2. Table cells with escapable prefixes
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html
+
+
a
+
-
+
+
+
+!! wikitext
+{|
+|a
+|-
+| -
+|-
+| +
+|}
+!! end
+
+!! test
+3a. Table cells with escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "table tbody tr:first-child td:first-child", "remove"]
+ ]
+}
+!! wikitext
+{|
+|a||-
+|}
+!! wikitext/edited
+{|
+| -
+|}
+!! end
+
+!! test
+3b. Table cells with escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "table tbody tr:first-child td:first-child", "html", "-" ],
+ [ "#x", "remove" ]
+ ]
+}
+!! wikitext
+{|
+|pqr
+|foo+
+|}
+!! wikitext/edited
+{|
+| -
+| +
+|}
+!! end
+
+# FIXME: This test will fail because
+# normalization doesn't realize that the id attribute
+# will eliminate the escapable scenario
+!! test
+4a. Table cells without escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "#x", "html", "-" ]
+ ]
+}
+!! wikitext
+{|
+| id="x" |abcd
+|}
+!! wikitext/edited
+{|
+| id="x" |-
+|}
+!! end
+
+## This tests normalizer's ability to discriminate between
+## cells having identical content.
+!! test
+4b. Table cells without escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "td", "html", "-" ]
+ ]
+}
+!! wikitext
+{|
+|a||b
+|}
+!! wikitext/edited
+{|
+| -||-
+|}
+!! end
+
+## This tests normalizer's ability to not be tripped by
+## comments (and whitespace)
+!! test
+4c. Table cells without escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "table tbody tr td:first-child", "remove" ]
+ ]
+}
+!! wikitext
+{|
+|-
+ |a||-
+|}
+!! wikitext/edited
+{|
+|-
+ | -
+|}
+!! end
+
+## This tests normalizer's ability to handle HTML cells
+!! test
+4d. Table cells without escapable prefixes after edits
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "td", "html", "-" ]
+ ]
+}
+!! wikitext
+
+
a
+
+!! wikitext/edited
+
+
-
+
+!! end
+
+!! test
+Escape nowiki DOM elements
+!! options
+parsoid=html2wt
+!! html/parsoid
+foo
+!! wikitext
+<nowiki>''foo''</nowiki>
!! end
# ---------------------------------------------------