From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- tests/parser/parserTest.inc | 9 +- tests/parser/parserTests.txt | 4327 +++++++++++++++----- .../parser/preprocess/All_system_messages.expected | 6 +- tests/parser/preprocess/All_system_messages.txt | 6 +- 4 files changed, 3242 insertions(+), 1106 deletions(-) (limited to 'tests/parser') diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 1cffa20c..f429c30a 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -155,7 +155,7 @@ class ParserTest { static function setUp() { global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, - $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, + $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo, $wgExtraInterlanguageLinkPrefixes, $wgLocalInterwikis, $parserMemc, $wgThumbnailScriptPath, $wgScriptPath, @@ -211,7 +211,6 @@ class ParserTest { $wgParserCacheType = CACHE_NONE; } - $wgEnableParserCache = false; DeferredUpdates::clearPendingUpdates(); $wgMemc = wfGetMainCache(); // checks $wgMainCacheType $messageMemc = wfGetMessageCacheStorage(); @@ -890,9 +889,9 @@ class ParserTest { 'wgDisableTitleConversion' => false, // Tidy options. 'wgUseTidy' => isset( $opts['tidy'] ), - 'wgAlwaysUseTidy' => false, + 'wgTidyConfig' => null, 'wgDebugTidy' => false, - 'wgTidyConf' => $IP . '/includes/tidy.conf', + 'wgTidyConf' => $IP . '/includes/tidy/tidy.conf', 'wgTidyOpts' => '', 'wgTidyInternal' => $this->tidySupport->isInternal(), ); @@ -937,6 +936,7 @@ class ParserTest { $wgHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp'; MagicWord::clearCache(); + MWTidy::destroySingleton(); return $context; } @@ -1219,6 +1219,7 @@ class ParserTest { FileBackendGroup::destroySingleton(); LockManagerGroup::destroySingletons(); LinkCache::singleton()->clear(); + MWTidy::destroySingleton(); foreach ( $this->savedGlobals as $var => $val ) { $GLOBALS[$var] = $val; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e9653529..c8c63f39 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -118,6 +118,13 @@ Template:echo_with_div
{{{1}}}
!! 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.
  1. There is not nowiki.
  2. @@ -1394,6 +1435,15 @@ nowiki 3
    • There is not nowiki.
    • There is nowiki.
    +!! html/parsoid +
    There is not nowiki.
    +
    There is nowiki.
    + +
    1. There is not nowiki.
    2. +
    3. 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

    This text : L''Foo

    !! 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 +

link

+!! html/parsoid

link

!! end !! test Parsoid: pipe in transclusion parameter -!! options -parsoid !! wikitext {{echo|http://foo.com/a|b}} -!! html +!! html/php+tidy +

http://foo.com/a%7Cb

+!! html/parsoid

http://foo.com/a|b

@@ -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 +

a|b

+!! html/parsoid

|bar"}},"i":0}}]}'}'>foo|bar <div> @@ -2659,19 +2833,21 @@ Templates: '=' char in nested transclusions should not trigger nowiki escapes or parsoid=html2wt,wt2wt !! wikitext {{echo|{{echo|1=bar}}}} -!! html +!! html/php+tidy +

bar

+!! html/parsoid

bar

!! end ## Bug 56733 !! test Templates parameters with special tokenizing behavior dont get modified because of arg escaping -!! options -parsoid !! wikitext {{echo|a : b}} -!! html -

a : b

+!! html/php+tidy +

a : b

+!! html/parsoid +

a : b

!! end ## Bug T73412 @@ -2679,13 +2855,23 @@ parsoid Templates: Preserve blank parameter names !! wikitext {{echo|=foo}} -!! html/php -

{{{1}}} -

+!! html/php+tidy +

{{{1}}}

!! html/parsoid

{{{1}}}

!! end +!! test +Templates: Preserve blank parameter names in other positions +!! wikitext +{{blank_param|bar|=foo}} +!! html/php+tidy +

bar foo

+!! html/parsoid +

bar +foo

+!! end + ### ### Parsoid-centric tests for testing RT edge cases for pre ### @@ -3136,9 +3322,10 @@ parsoid=wt2html,wt2wt !! wikitext [[Category:foo]] {{echo| [[Category:foo]]}} -!! html - - +!! html/php+tidy +!! html/parsoid + + !! end !! test @@ -3149,9 +3336,22 @@ parsoid=wt2html,wt2wt [[Category:foo]] a [[Category:foo]] {{echo|b}} !! html -
- a
- b
+
 a
+  b
+!! end + +!! test +Indent-Pre: Newlines in comments shouldn't affect sol state +!! wikitext +a b +!! html/php+tidy +

a b

+!! html/parsoid +

a b

!! end ### @@ -3177,8 +3377,10 @@ foo foo
-!! html -
foo
+!! html/php+tidy +
+foo
+
 foo
 
@@ -3191,7 +3393,6 @@ foo foo - !! html/parsoid
foo
@@ -3230,7 +3431,7 @@ haha -!! html +!! html/php+tidy
 
 
@@ -3247,7 +3448,6 @@ haha
 
 
 
- !! html/parsoid
 
@@ -3290,7 +3490,7 @@ HTML-pre: 3: other wikitext
 '' no-italic ''
 [[ NoLink ]]
 
-!! html +!! html/php
 * foo
 # bar
@@ -3299,6 +3499,13 @@ HTML-pre: 3: other wikitext
 [[ NoLink ]]
 
+!! html/parsoid +
* foo
+# bar
+= no-h =
+'' no-italic ''
+[[ NoLink ]]
+
!!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 +

http:// +http://; +(http://) +bitcoin: +bitcoin:; +(bitcoin:) +

+!! end + !! test External links: No preceding word characters allowed (bug 65278) !! wikitext @@ -4981,38 +5249,6 @@ External link containing a single quote. (bug 63947)

bang

!! end - -!! test -External link containing a period in the anchor. (bug 63947) -!! wikitext -[//foo.org/bar#baz. bang] - -[//foo.org/bar. bang] -!! html/php -

bang -

bang -

-!! html/parsoid -

bang

-

bang

-!! end - -!! test -External link containing a single quote. (bug 63947) -!! wikitext -[//foo.org/bar'baz] - -[//foo.org/bar'baz bang] -!! html/php -

[1] -

bang -

-!! html/parsoid -

-

bang

-!! 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

Google

+!! html/parsoid +

Google

+!! end + +!! test +External link to bare IPv4 address +!! wikitext +[http://192.168.0.1 Link] +!! html/php +

Link +

+!! html/parsoid +

Link

!! end !! test @@ -5088,14 +5337,129 @@ http://example.com/index.php?foozoid[]=bar !! end !! test -IPv6 urls (bug 21261) -!! options -disabled +IPv6 urls, autolink format (T23261) !! wikitext http://[2404:130:0:1000::187:2]/index.php -!! html + +Examples from RFC 2373, section 2.2: +* http://[1080::8:800:200C:417A]/unicast +* http://[FF01::101]/multicast +* http://[::1]/loopback +* http://[::]/unspecified +* http://[::13.1.68.3]/ipv4compat +* http://[::FFFF:129.144.52.38]/ipv4compat + +Examples from RFC 2732, section 2: +* http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html +* http://[1080:0:0:0:8:800:200C:417A]/index.html +* http://[3ffe:2a00:100:7031::1] +* http://[1080::8:800:200C:417A]/foo +* http://[::192.9.5.5]/ipng +* http://[::FFFF:129.144.52.38]:80/index.html +* http://[2010:836B:4179::836B:4179] + +!! html/php

http://[2404:130:0:1000::187:2]/index.php -

+

Examples from RFC 2373, section 2.2: +

+ +

Examples from RFC 2732, section 2: +

+ + +!! html/parsoid +

http://[2404:130:0:1000::187:2]/index.php

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ +!! end + +!! test +IPv6 urls, bracketed format (T23261) +!! wikitext +[http://[2404:130:0:1000::187:2]/index.php test] + +Examples from RFC 2373, section 2.2: +* [http://[1080::8:800:200C:417A] unicast] +* [http://[FF01::101] multicast] +* [http://[::1]/ loopback] +* [http://[::] unspecified] +* [http://[::13.1.68.3] ipv4compat] +* [http://[::FFFF:129.144.52.38] ipv4compat] + +Examples from RFC 2732, section 2: +* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1] +* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2] +* [http://[3ffe:2a00:100:7031::1] 3] +* [http://[1080::8:800:200C:417A]/foo 4] +* [http://[::192.9.5.5]/ipng 5] +* [http://[::FFFF:129.144.52.38]:80/index.html 6] +* [http://[2010:836B:4179::836B:4179] 7] + +!! html/php +

test +

Examples from RFC 2373, section 2.2: +

+ +

Examples from RFC 2732, section 2: +

+ + +!! html/parsoid +

test

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ !! 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

[foo] [foo bar] [foo bar] @@ -5126,7 +5491,22 @@ Non-extlinks in brackets [fool's errand] [url=foo] [url=http://example.com] +[http:// bare protocols don't count]

+!! html/parsoid +

[foo] +[foo bar] +[foo bar] +[fool's] errand +[fool's errand] +[foo] +[foo bar] +[foo bar] +[fool's] errand +[fool's errand] +[url=foo] +[url=http://example.com] +[http:// bare protocols don't count]

!! end !! test @@ -5208,15 +5588,55 @@ Parenthesis in external links, w/ transclusion or comment !! end !! test -Replace invalid link targets when serializing +Serialize tags with invalid link targets as plain text !! options parsoid=html2wt -!! html -Manual +!! html/parsoid +text +*text +[[foo]] +*a [[foo]] +!! wikitext +text +*text +[[foo]] +*a [[foo]] +!! end + +!! test +mw:ExtLink -vs- mw:WikiLink (T94723) +!! options +parsoid=html2wt +!! html/parsoid +Bar +Bar +Bar +Bar +

+European Robin +European Robin +

+!! 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 bc +
+ +!! html/parsoid + + +!! end + +!! test +Accept "!!" in table headings after newline +!! wikitext +{| +!a +b!!c +|} +!! html/php +
a bc
+ +
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 + + + + +
barbar 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 + + + + + + + + +
FooBarFoo and Baz +
FooBarFoo and Baz +
+ +!! html/parsoid + + + + +
FooBarFoo and Baz
FooBarFoo 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 + + +
Foo[1]
+
  1. foo
+!! 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

MemoryAlpha:AlphaTest

!! wikitext [[MemoryAlpha:AlphaTest]] @@ -6810,7 +7385,7 @@ Link containing a tilde !! wikitext [[Foo~bar]] !! html/php -

Foo~bar +

Foo~bar

!! html/parsoid

Foo~bar

@@ -6884,10 +7459,10 @@ Broken image links with HTML captions (bug 39700) abc

!! html/parsoid -

- - -

+

+ + +

!! end !! test @@ -7125,7 +7700,7 @@ title=[[User:test/123]]

b

!! html/parsoid -

b

+

b

!! 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

apples

!! wikitext [[apple]]s @@ -7215,7 +7790,7 @@ Parsoid link prefix escaping !! options language=is parsoid=html2wt,html2html -!! html +!! html/parsoid

Aðrir mótmælendasöfnuður

!! wikitext Aðrir mótmælenda[[söfnuður]] @@ -7515,7 +8090,6 @@ Blah blah blah [[ es :Spanish]] [[ ZH :Chinese]] [[es:Foo_bar]] -[[es:Foo bar]] !! html/php

Blah blah blah

@@ -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

He&nbsp;llo He&nbsp;llo

He&nbsp;llo He&nbsp;llo

!! wikitext @@ -7693,7 +8281,7 @@ Blah blah blah

!! html/parsoid

Blah blah blah -mi:Template:Foo

+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 - +
  1. 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
  1. 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

!! html/php -


-
+


+



@@ -8225,7 +8822,7 @@ parsoid !! wikitext * !! html/parsoid -

    +
      !! 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

      RFC 123

      +!! html/parsoid +

      RFC 123

      !! end !! test Magic links: RFC (bug 479) !! wikitext RFC 822 -!! html +!! html/php

      RFC 822

      +!! html/parsoid +

      RFC 822

      !! end !! test Magic links: RFC (bug 65278) !! wikitext This is RFC 822 but thisRFC 822 is not RFC 822linked. -!! html +!! html/php

      This is RFC 822 but thisRFC 822 is not RFC 822linked.

      +!! html/parsoid +

      This is RFC 822 but thisRFC 822 is not RFC 822linked.

      !! end !! test @@ -9371,20 +9987,26 @@ Magic links: RFC (w/ non-newline whitespace, bug 28950/29025) RFC       822 RFC 822 -!! html +!! html/php

      RFC 822 RFC 822

      +!! html/parsoid +

      RFC       822 +RFC +822

      !! end !! test Magic links: ISBN (bug 1937) !! wikitext ISBN 0-306-40615-2 -!! html +!! html/php

      ISBN 0-306-40615-2

      +!! html/parsoid +

      ISBN 0-306-40615-2

      !! end !! test @@ -9395,7 +10017,7 @@ This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-

      This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

      !! html/parsoid -

      This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

      +

      This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

      !! end !! test @@ -9406,31 +10028,41 @@ ISBN 9780316098113 ISBN 978 0316098113 -!! html +!! html/php

      ISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113

      +!! html/parsoid +

      ISBN       978 0 316 09811 3 +ISBN +9780316098113 +ISBN 978 +0316098113

      !! end !! test Magic links: PMID incorrectly converts space to underscore !! wikitext PMID 1234 -!! html +!! html/php

      PMID 1234

      +!! html/parsoid +

      PMID 1234

      !! end !! test Magic links: PMID (bug 65278) !! wikitext This is PMID 1234 but thisPMID 1234 is not PMID 1234linked. -!! html +!! html/php

      This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

      +!! html/parsoid +

      This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

      !! end !! test @@ -9439,11 +10071,15 @@ Magic links: PMID (w/ non-newline whitespace, bug 28950/29025) PMID       1234 PMID 1234 -!! html +!! html/php

      PMID 1234 PMID 1234

      +!! html/parsoid +

      PMID       1234 +PMID +1234

      !! 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] + +
      + +
      1. foo
      +!!end + +!! test +Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered +!! wikitext +{{echo| +{{{!}} +{{!}}-}} + +|foo + +{{!}}} +!! html/parsoid + + + + + +
      foo +
      +!! end + !!test Templates: Lists: Multi-line list-items via templates !! wikitext @@ -11093,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 @@ -11138,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 @@ -11154,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 @@ -11171,7 +11913,7 @@ pre-save transform: comment in subst (bug 1936) pst !! wikitext {{subst:commenttest}} -!! html +!! html/php This template has in it. !! end @@ -11181,7 +11923,7 @@ pre-save transform: unclosed tag pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11191,7 +11933,7 @@ pre-save transform: mixed tag case pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11201,7 +11943,7 @@ pre-save transform: unclosed comment in pst noxml !! wikitext wikinowiki -!! html +!! html/php !!end @@ -11239,7 +11981,7 @@ pre-save transform: comment containing extension pst !! wikitext -!! html +!! html/php !!end @@ -11249,7 +11991,7 @@ pre-save transform: comment containing nowiki pst !! wikitext -!! html +!! html/php !!end @@ -11259,7 +12001,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes}} -!! html +!! html/php Foobar !! end @@ -11269,7 +12011,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes2}} -!! html +!! html/php Foo !! end @@ -11291,7 +12033,7 @@ bug 22297: safesubst: works during PST pst !! wikitext {{subst:SafeSubstTest}}{{safesubst:SubstTest}} -!! html +!! html/php FoobarFoobar !! end @@ -11327,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]] @@ -11348,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]] @@ -11361,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 @@ -11373,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]] @@ -11386,7 +12128,7 @@ pst title=[[Someplace (IGNORED), Somewhere]] !! wikitext [[|Otherplace]] [[Otherplace (place), Elsewhere|]] -!! html +!! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace (place), Elsewhere|Otherplace]] !! end @@ -11398,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 @@ -11409,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 @@ -11419,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 @@ -11429,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 @@ -11439,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 @@ -11449,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 @@ -11464,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]] @@ -11484,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]] @@ -11504,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]] @@ -11524,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]] @@ -11543,7 +12285,7 @@ Empty lines are trimmed -!! html +!! html/php Empty lines are trimmed !! end @@ -11556,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]] @@ -11587,7 +12329,7 @@ As well as inside noinclude/onlyinclude But not inside includeonly {{subst:Foo}} -!! html +!! html/php Shall not expand: ~~~~ @@ -11642,7 +12384,7 @@ parsoid=wt2html Parsoid: Escape nowiki with trailing space in tags !! options parsoid=html2wt -!! html +!! html/parsoid

      <nowiki > foo </nowiki >

      a<nowiki />b

      c<nowiki/ >d

      @@ -11658,7 +12400,7 @@ c<nowiki/ >d Parsoid: Escape weird noWikI capitalizations !! options parsoid=html2wt -!! html +!! html/parsoid

      <noWikI > foo </NoWikI >

      !! wikitext <noWikI > foo </NoWikI > @@ -11921,7 +12663,7 @@ parsoid=wt2html,wt2wt,html2html
      This is a caption
      !! 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

      caption

      !! html/parsoid -

      +

      !! end !! test @@ -12027,7 +12769,7 @@ thumbsize=220

      caption

      !! html/parsoid -
      caption
      +
      caption

      !! end @@ -12043,9 +12785,9 @@ Image with width attribute at different positions
      Caption
      !! html/parsoid -
      Caption
      -
      Caption
      -
      Caption
      +
      Caption
      +
      Caption
      +
      Caption
      !! end # a sad bit of backward-compatibility @@ -12061,7 +12803,7 @@ parsoid=wt2html,wt2wt,html2html Foobar.jpg

      !! 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

      testing bold in alt

      !! html/parsoid -

      -

      testing bold in alt

      +

      +

      testing bold in alt

      !! end !! test @@ -12334,9 +13089,9 @@ parsoid=wt2html,wt2wt,html2html

      caption

      !! 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

      Foobar.jpg

      !! html/parsoid -

      -

      +

      +

      !! end !! test @@ -12418,8 +13173,8 @@ parsoid=wt2html,wt2wt,html2html

      Foobar.jpg

      !! html/parsoid -

      -

      +

      +

      !! end !! test @@ -12432,7 +13187,7 @@ parsoid=wt2html,wt2wt,html2html
      Foobar.jpg
      !! html/parsoid -
      +
      !! end !! test @@ -12448,8 +13203,8 @@ parsoid=wt2html,wt2wt,html2html
      Foobar.svg
      !! html/parsoid -
      -
      +
      +
      !! end !! test @@ -12462,7 +13217,7 @@ parsoid=wt2html,wt2wt,html2html

      Foobar.jpg

      !! html/parsoid -

      +

      !! end !! test @@ -12478,8 +13233,8 @@ parsoid=wt2html,wt2wt,html2html

      Foobar.svg

      !! html/parsoid -

      -

      +

      +

      !! end !! test @@ -12537,7 +13292,7 @@ Frameless image caption with a free URL

      http://example.com

      !! html/parsoid -

      +

      !! end !! test @@ -12550,7 +13305,7 @@ thumbsize=220 !! html/parsoid -
      http://example.com
      +
      http://example.com
      !! end !! test @@ -12564,7 +13319,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid -
      Alteration
      http://example.com
      +
      Alteration
      http://example.com
      !! end !! test @@ -12576,7 +13331,7 @@ SVG thumbnails with no language set
      caption
      !! html/parsoid -
      caption
      +
      caption
      !! end !! test @@ -12589,7 +13344,7 @@ parsoid=wt2html,wt2wt,html2html
      caption
      !! html/parsoid -
      caption
      +
      caption
      !! end !! test @@ -12613,7 +13368,7 @@ BUG 1887: A ISBN with a thumbnail !! html/parsoid -
      ISBN 1235467890
      +
      ISBN 1235467890
      !! end !! test @@ -12624,7 +13379,7 @@ BUG 1887: A RFC with a thumbnail
      This is RFC 12354
      !! html/parsoid -
      This is RFC 12354
      +
      This is RFC 12354
      !! end !! test @@ -12635,7 +13390,7 @@ BUG 1887: A mailto link with a thumbnail !! html/parsoid -
      Please mailto:nobody@example.com
      +
      Please mailto:nobody@example.com
      !! end # Pending resolution to bug 368 @@ -12647,7 +13402,7 @@ BUG 648: Frameless image caption with a link

      text with a link in it

      !! html/parsoid -

      +

      !! end !! test @@ -12658,7 +13413,7 @@ BUG 648: Frameless image caption with a link (suffix)

      text with a linkfoo in it

      !! html/parsoid -

      +

      !! end !! test @@ -12669,7 +13424,7 @@ BUG 648: Frameless image caption with an interwiki link

      text with a MeatBall:Link in it

      !! html/parsoid -

      +

      !! end !! test @@ -12680,7 +13435,15 @@ BUG 648: Frameless image caption with a piped interwiki link

      text with a link in it

      !! 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 image 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 @@ -12786,7 +13549,7 @@ Bug 3090: External links other than http: in image captions
      This caption has irc and Secure ext links in it.
      !! 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

      caption

      !! html/parsoid -

      +

      !! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -12863,9 +13626,9 @@ parsoid=wt2html,wt2wt,html2html
      caption
      !! html/parsoid -
      caption
      -
      caption
      -
      caption
      +
      caption
      +
      caption
      +
      caption
      !! end !! article @@ -12910,7 +13673,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -

      +

      !! end !! test @@ -12921,7 +13684,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid -

      +

      !! end !! test @@ -12930,7 +13693,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid -

      +

      !! end !! test @@ -12941,7 +13704,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid -

      +

      !! end !! test @@ -12965,7 +13728,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|left|baseline|thumb|caption content]] !! html/parsoid -
      caption content
      +
      caption content
      !! end !! test @@ -12974,7 +13737,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|thumb|left|baseline|caption content]] !! html/parsoid -
      caption content
      +
      caption content
      !! end !! test @@ -12982,7 +13745,7 @@ Parsoid-specific image handling - thumbnail with specific size, halign, valign, !! wikitext [[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] !! html/parsoid -
      caption
      +
      caption
      !! end !! test @@ -13029,7 +13792,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|
      Foo Bar
      ab
      c
      ]] !! html/parsoid -

      +

      !! end !! test @@ -13050,7 +13813,7 @@ foo bar !! html/parsoid

      foo

      -
      This caption has a
      unbalanced tag in it.
      +
      This caption has a
      unbalanced tag in it.

      bar

      !! end @@ -13061,7 +13824,7 @@ parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! html/parsoid -
      +
      !! end # empty captions don't get serialized unless we're in the "round trip" case @@ -13088,7 +13851,7 @@ Parsoid-specific image handling - whitespace caption !! wikitext [[File:Foobar.jpg|thumb| ]] !! html/parsoid -
      +
      !! end !! test @@ -13103,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]
      + +
      1. foo
      +!! end + +!! test +T93580: 2. inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: foo]] + + +!! html/parsoid +

      + +
      1. foo
      +!! end + +!! test +T93580: 3. Templated inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: {{echo|{{echo|foo}}}}]] + + +!! html/parsoid +

      + +
      1. foo
      +!! 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

      -Category:Foo -Bar +Category:Foo +Bar

      !! 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

      Contents

      • 1 Headline 2
      • @@ -13744,6 +14695,22 @@ TOC regression (T11764) !! end +!! test +TOC for heading containing (T96153) +!! wikitext +__FORCETOC__ +==New title== +!! html/php +

        Contents

        + +
        + +

        New title[edit]

        + +!! 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 -wiki-tags without Extension:Math enabled Parser hook: empty input !! wikitext -!! html +!! html/php
         ''
         array (
        @@ -15076,7 +16048,7 @@ array (
         Parser hook: empty input using terminated empty elements
         !! wikitext
         
        -!! html
        +!! html/php
         
         NULL
         array (
        @@ -15089,7 +16061,7 @@ array (
         Parser hook: empty input using terminated empty elements (space before)
         !! wikitext
         
        -!! html
        +!! html/php
         
         NULL
         array (
        @@ -15102,7 +16074,7 @@ array (
         Parser hook: basic input
         !! wikitext
         input
        -!! html
        +!! html/php
         
         'input'
         array (
        @@ -15116,7 +16088,7 @@ array (
         Parser hook: case insensitive
         !! wikitext
         input
        -!! html
        +!! html/php
         
         'input'
         array (
        @@ -15130,7 +16102,7 @@ array (
         Parser hook: case insensitive, redux
         !! wikitext
         input
        -!! html
        +!! html/php
         
         'input'
         array (
        @@ -15145,7 +16117,7 @@ Parser hook: nested tags
         noxml
         !! wikitext
         
        -!! html
        +!! html/php
         
         ''
         array (
        @@ -15158,14 +16130,14 @@ array (
         Parser hook: basic arguments
         !! wikitext
         
        -!! html
        +!! html/php
         
         ''
         array (
           'width' => '200',
           'height' => '100',
           'depth' => '50',
        -  'square' => 'square',
        +  'square' => '',
         )
         
        @@ -15175,7 +16147,7 @@ array ( Parser hook: argument containing a forward slash (bug 5344) !! wikitext -!! html +!! html/php
         ''
         array (
        @@ -15189,7 +16161,7 @@ array (
         Parser hook: empty input using terminated empty elements (bug 2374)
         !! wikitext
         text
        -!! html
        +!! html/php
         
         NULL
         array (
        @@ -15206,14 +16178,14 @@ Parser hook: basic arguments using terminated empty elements (bug 2374)
         
         other stuff
         
        -!! html
        +!! html/php
         
         NULL
         array (
           'width' => '200',
           'height' => '100',
           'depth' => '50',
        -  'square' => 'square',
        +  'square' => '',
         )
         

        other stuff @@ -15230,7 +16202,7 @@ Parser hook: static parser hook not inside a comment !! wikitext hello, world -!! html +!! html/php

        hello, world

        !! end @@ -15241,7 +16213,7 @@ Parser hook: static parser hook inside a comment !! wikitext -!! html +!! html/php


        !! end @@ -15300,20 +16272,24 @@ Sanitizer: Closing of open but not closed tags !! test Sanitizer: Closing of closed but not open tags +!! options +parsoid=wt2html !! wikitext -!! html -

        </s> -

        +!! html/php+tidy +!! html/parsoid !! end !! test Sanitizer: Closing of closed but not open table tags +!! options +parsoid=wt2html !! wikitext Table not started -!! 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
      +
      &#00;
      +
      FF
      +
      &#xC;
      +
      CR
      +
      &#xD;
      +
      Control (low)
      +
      &#8;
      +
      Control (high)
      +
      &#x7F; &#x9F;
      +
      Surrogate
      +
      &#xD83D;&#xDCA9;
      +
      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

      ISBN 978-0-1234-56 789

      !! html/parsoid -

      ISBN 978-0-1234-56 789

      +

      ISBN 978-0-1234-56 789

      !! end !! test @@ -17378,24 +18383,34 @@ ISBN ISBN 1234567890

      ISBN ISBN 1234567890

      !! html/parsoid -

      ISBN ISBN 1234567890

      +

      ISBN ISBN 1234567890

      !! 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

      ISBN 3-462-04561-X +ISBN 3-462-04561-x ISBN 080442957X +ISBN 080442957x ISBN 978080442957X +ISBN 978080442957x

      !! html/parsoid -

      ISBN 3-462-04561-X -ISBN 080442957X -ISBN 978080442957X

      +

      ISBN 3-462-04561-X +ISBN 3-462-04561-x +ISBN 080442957X +ISBN 080442957x +ISBN 978080442957X +ISBN 978080442957x

      !! end !! test @@ -17406,7 +18421,7 @@ ISBN 1234567890

      ISBN 1234567890

      !! html/parsoid -

      ISBN 1234567890

      +

      ISBN 1234567890

      !! end !! test @@ -17417,7 +18432,7 @@ Bug 22905: followed by ISBN followed by

      (fr) ISBN 2753300917 example.com

      !! html/parsoid -

      (fr) ISBN 2753300917 example.com

      +

      (fr) ISBN 2753300917 example.com

      !! end !! test @@ -17548,7 +18563,7 @@ Images with the "|" character in the comment
      An external URL
      !! 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) 3E 3E+

      !! html/parsoid -

      User:+% Page+title% %+ %20 %+ %+r % + 3E 3E+

      +

      User:+% Page+title% +%+ %20 %+ %+r +% + +3E 3E+

      !! end !! test @@ -19382,7 +20455,7 @@ Special characters in embedded file links (bug 27679)

      !! html/parsoid

      -

      +

      !! end !! test @@ -19653,14 +20726,18 @@ __TOC__

      [edit]

      !! 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

      Contents

      • 1 Hello
      • @@ -19669,8 +20746,13 @@ __TOC__

      Hello[edit]

      -

      b">Evilbye[edit]

      +

      b">Evilbye[edit]

      + +!! html/parsoid + +

      Hello

      +

      b">Evilbye

      !! end !! test @@ -19775,10 +20857,12 @@ Strip marker in urlencode {{urlencode:xy}} {{urlencode:xy|wiki}} {{urlencode:xy|path}} +{{urlencode:x
      two
      y}} !! html

      xy xy xy +xy

      !! end @@ -20137,10 +21221,35 @@ parsoid=wt2html,wt2wt [[Image:Foobar.jpg|right|300px]] !! html/parsoid +

      foo

      -
      caption
      +
      caption

      bar

      -
      +
      +!! 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 -

      A [1] -B [2] -C [3]

      -
        -
      1. foo
      2. -
      3. foo
      4. -
      5. +

        A [1] +B [2] +C [3]

        +
          +
        1. foo
        2. +
        3. foo
        4. +
        !!end @@ -20178,10 +21287,10 @@ A foo B !! html -

        A [1] -B [1]

        -
          -
        1. 1.0 1.1 foo
        2. +

          A [1] +B [1]

          +
            +
          1. 1 2 foo
          !!end @@ -20195,11 +21304,11 @@ B C !! html -

          A [1] -B [1] -C [1]

          -
            -
          1. 1.0 1.1 1.2 foo
          2. +

            A [1] +B [1] +C [1]

            +
              +
            1. 1 2 3 foo
            !!end @@ -20212,9 +21321,9 @@ parsoid A foo !! html -

            A [1]

            -
              -
            1. foo
            2. +

              A [1]

              +
                +
              1. foo
              !!end @@ -20229,10 +21338,10 @@ A !! html -

              A [1]

              +

              A [1]

              -
                -
              1. This is a bolded link and this is a transclusion +
                  +
                1. This is a bolded link and this is a transclusion
                !!end @@ -20250,10 +21359,10 @@ A !! html -

                A [1]

                +

                A [1]

                -
                  -
                1. foo +
                    +
                  1. foo bar baz
                  2. @@ -20280,10 +21389,10 @@ booz !! html -

                    A [1]

                    +

                    A [1]

                    -
                      -
                    1. foo +
                        +
                      1. foo bar @@ -20306,9 +21415,9 @@ A foo {{echo| B C}} !! html -

                        A [1] B C}}

                        -
                          -
                        1. foo {{echo|
                        2. +

                          A [1] B C}}

                          +
                            +
                          1. foo {{echo|
                          !!end @@ -20320,9 +21429,9 @@ parsoid A foo +

                          A [1] B C

                          +
                            +
                          1. foo
                          !!end @@ -20335,11 +21444,11 @@ A foo B C !! html -

                          A [1] B C

                          +

                          A [1] B C

                          -
                            -
                          1. foo
                          2. +
                              +
                            1. foo
                            !!end @@ -20352,37 +21461,35 @@ A foo B C bar D !! html -

                            A [1] B -C [2] D

                            -
                              -
                            1. foo
                            2. -
                            3. bar
                            4. +

                              A [1] B +C [2] D

                              +
                                +
                              1. foo
                              2. +
                              3. bar
                              !!end !!test Ref: 12. ref-tags act as trailing newline migration barrier -!!options -parsoid !! wikitext -a +a -b +b c -!! html -

                              a

                              +!! html/parsoid +

                              a

                              -

                              b [1] -[2]

                              +

                              b [1] +[2]

                              c

                              -
                                -
                              1. -
                              +
                                +
                              1. +
                              !!end !!test @@ -20395,11 +21502,11 @@ parsoid
                              B !! html -

                              [1] A -[2] B

                              -
                                -
                              1. foo
                              2. -
                              3. bar +

                                [1] A +[2] B

                                +
                                  +
                                1. foo
                                2. +
                                3. bar
                                !!end @@ -20413,10 +21520,10 @@ parsoid !! html -

                                [1] +

                                [1]

                                -
                                  -
                                1. foo <ref>bar</ref> baz
                                2. +
                                    +
                                  1. foo <ref>bar</ref> baz
                                  !!end @@ -20430,10 +21537,10 @@ B1 B2 bar !! html -

                                  A1 [1] A2 [1] -B1 [2] B2 [2]

                                  +

                                  A1 [1] A2 [1] +B1 [2] B2 [2]

                                  -
                                  1. 1.0 1.1 foo
                                  2. 2.0 2.1 bar
                                  3. +
                                    1. 1 2 foo
                                    2. 1 2 bar
                                    !!end @@ -20447,9 +21554,9 @@ A foo !! html -

                                    A [1]

                                    -
                                      -
                                    1. foo
                                    +

                                    A [1]

                                    +
                                      +
                                    1. foo
                                    !!end !!test @@ -20461,11 +21568,11 @@ parsoid !!html -

                                    [1] +

                                    [1]

                                    -
                                      -
                                    1. foo
                                    2. +
                                        +
                                      1. foo
                                      !!end @@ -20478,11 +21585,11 @@ parsoid !!html -

                                      [1] +

                                      [1]

                                      -
                                        -
                                      1. foo
                                      2. +
                                          +
                                        1. foo
                                        !!end @@ -20495,10 +21602,10 @@ parsoid !! html -

                                        1 [1] 2 [1] +

                                        1 [1] 2 [1]

                                        -
                                          -
                                        1. 1.0 1.1 foo
                                        2. +
                                            +
                                          1. 1 2 foo
                                          !!end @@ -20513,28 +21620,24 @@ C !! html -

                                          A [1] -B [1] -C [1]

                                          +

                                          A [1] +B [1] +C [1]

                                          -
                                          1. 1.0 1.1 1.2 Foo one
                                          2. +
                                            1. 1 2 3 Foo one
                                            !!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 -

                                                A [a 1] -B [b 1] -C [1]

                                                +!! html/parsoid +

                                                A [a 1] +B [b 1] +C [1]

                                                -
                                                  -
                                                1. foo
                                                2. +
                                                    +
                                                  1. foo
                                                  -
                                                    -
                                                  1. baz
                                                  2. +
                                                      +
                                                    1. baz
                                                    -
                                                      -
                                                    1. bar
                                                    2. +
                                                        +
                                                      1. bar
                                                      !!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 -

                                                      A [1]

                                                      +!! html/parsoid +

                                                      A [1]

                                                      -
                                                      1. foo
                                                      2. +
                                                        1. foo
                                                        -

                                                        B [1]

                                                        +

                                                        B [1]

                                                        -
                                                          -
                                                        1. bar
                                                        2. +
                                                            +
                                                          1. bar
                                                          !!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 -

                                                          A [a 1] -B [1]

                                                          +!! html/parsoid +

                                                          A [a 1] +B [1]

                                                          -
                                                          1. afoo
                                                          2. +
                                                            1. afoo
                                                            -

                                                            C [2]

                                                            +

                                                            C [2]

                                                            -
                                                            1. bfoo
                                                            2. cfoo
                                                            3. +
                                                              1. bfoo
                                                              2. cfoo
                                                              !!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 bar foo This should just get lost. -!! html -

                                                              A [1] -B [2]

                                                              +!! html/parsoid +

                                                              A [1] +B [2]

                                                              -
                                                              1. foo
                                                              2. bar
                                                              3. +
                                                                1. foo
                                                                2. bar
                                                                !!end !!test References: 6. from a transclusion -!!options -parsoid !! wikitext Foo {{echo|}} -!! html -

                                                                [1]

                                                                1. Foo
                                                                2. +!! html/parsoid +

                                                                  [1]

                                                                  1. Foo
                                                                  !!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 -

                                                                  A [1] -B [X 1] +!! html/parsoid +

                                                                  A [1] +B [X 1]

                                                                  -
                                                                    -
                                                                  1. foo bar for a
                                                                  2. +
                                                                      +
                                                                    1. foo bar for a
                                                                    -
                                                                      -
                                                                    1. foo
                                                                    2. +
                                                                        +
                                                                      1. foo
                                                                      !! 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 -

                                                                      X[1]

                                                                      -
                                                                      1. foo bar and baz boo
                                                                      2. +!! html/parsoid +

                                                                        X[1]

                                                                        +
                                                                        1. foo bar and baz boo
                                                                        !!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 -

                                                                        A [1] B [inexistent 1]

                                                                        -
                                                                          -
                                                                        1. foo
                                                                        2. +!! html/parsoid +

                                                                          A [1] B [inexistent 1]

                                                                          +
                                                                            +
                                                                          1. foo
                                                                          -
                                                                            -
                                                                          1. bar
                                                                          2. +
                                                                              +
                                                                            1. bar
                                                                            !! end @@ -20721,15 +21810,13 @@ A foo !! test Entities in ref name -!! options -parsoid !! wikitext hi -!! html -

                                                                            [1]

                                                                            -
                                                                              -
                                                                            1. hi
                                                                            2. +!! html/parsoid +

                                                                              [1]

                                                                              +
                                                                                +
                                                                              1. hi
                                                                              !! end @@ -20743,10 +21830,10 @@ parsoid=wt2html afoo -!! html -

                                                                              a[1]

                                                                              -
                                                                                -
                                                                              1. foo
                                                                              +!! html/parsoid +

                                                                              a[1]

                                                                              +
                                                                                +
                                                                              1. foo
                                                                              !! 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 +

                                                                                  =foo=

                                                                                  + +

                                                                                  =foo= + +=foo=

                                                                                  + +

                                                                                  =fooa=

                                                                                  !! wikitext =foo= - =foo= + =foo= =foo= =foo''a''= -!! html -

                                                                                  =foo=

                                                                                  - -

                                                                                  =foo= - -=foo=

                                                                                  - -

                                                                                  =fooa=

                                                                                  !!end # New headings and existing headings are handled differently @@ -20888,7 +21975,7 @@ parsoid Headings: 1. Nested inside html !! options parsoid=html2wt -!! html +!! html/parsoid

                                                                                  =foo=

                                                                                  =foo=

                                                                                  =foo=

                                                                                  @@ -20919,7 +22006,7 @@ parsoid=html2wt Headings: 2. Outside heading nest on a single line

                                                                                  foo

                                                                                  *bar !! options parsoid=html2wt -!! html +!! html/parsoid

                                                                                  foo

                                                                                  *bar

                                                                                  foo

                                                                                  =bar

                                                                                  foo

                                                                                  =bar= @@ -20937,15 +22024,26 @@ parsoid=html2wt !! test Headings: 3. Nested inside html with wikitext split by html tags !! options -parsoid=html2wt,wt2wt -!! wikitext -= ='''bold'''foo= = +parsoid=html2wt !! html/parsoid

                                                                                  =boldfoo=

                                                                                  +!! wikitext += ='''bold'''foo= = !!end !! test Headings: 4a. No escaping needed (testing just h1 and h2) +!! options +parsoid=html2wt +!! html/parsoid +

                                                                                  =foo

                                                                                  +

                                                                                  foo=

                                                                                  +

                                                                                  =foo=

                                                                                  +

                                                                                  =foo= bar

                                                                                  +

                                                                                  =foo

                                                                                  +

                                                                                  foo=

                                                                                  +

                                                                                  =

                                                                                  +

                                                                                  =foo=

                                                                                  !! wikitext = =foo = @@ -20962,22 +22060,13 @@ Headings: 4a. No escaping needed (testing just h1 and h2) = = = = ''=''foo= = -!! html/parsoid -

                                                                                  =foo

                                                                                  -

                                                                                  foo=

                                                                                  -

                                                                                  =foo=

                                                                                  -

                                                                                  =foo= bar

                                                                                  -

                                                                                  =foo

                                                                                  -

                                                                                  foo=

                                                                                  -

                                                                                  =

                                                                                  -

                                                                                  =foo=

                                                                                  !!end !! test Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt -!! html +!! html/parsoid

                                                                                  === =foo= x =foo= @@ -20991,7 +22080,19 @@ parsoid=html2wt !! test Headings: 5. Empty headings !! options -parsoid +parsoid=html2wt +!! html/parsoid +

                                                                                  + +

                                                                                  + +

                                                                                  + +

                                                                                  + +
                                                                                  + +
                                                                                  !! wikitext == @@ -21004,92 +22105,81 @@ parsoid ========== ============ -!! html -

                                                                                  -

                                                                                  -

                                                                                  -

                                                                                  -
                                                                                  -
                                                                                  !!end !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) !! options -parsoid +parsoid=html2wt +!! html/parsoid +

                                                                                  =a=

                                                                                  + +

                                                                                  =a=

                                                                                  + +

                                                                                  =a=

                                                                                  !! wikitext =a= =a= =a= - -=a= -!! html -

                                                                                  =a=

                                                                                  -

                                                                                  =a=

                                                                                  -

                                                                                  =a=

                                                                                  -

                                                                                  =a=

                                                                                  !!end !! test Headings: 6b. Heading chars in SOL context (with trailing newlines) !! options -parsoid -!! wikitext -=a= -b - -=a= -b - -=a= -b - -=a= -b -!! html +parsoid=html2wt +!! html/parsoid

                                                                                  =a= b

                                                                                  +

                                                                                  =a= b

                                                                                  +

                                                                                  =a= b

                                                                                  -

                                                                                  =a= -b

                                                                                  -

                                                                                  +!! wikitext +=a= +b + +=a= +b + +=a= +b !!end !! test Headings: 6c. Heading chars in SOL context (leading newline break) !! options -parsoid +parsoid=html2wt +!! html/parsoid +

                                                                                  a +=b=

                                                                                  !! wikitext a =b= -!! html -

                                                                                  a -=b=

                                                                                  !!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
                                                                                  +
                                                                                  1. *foo
                                                                                  +
                                                                                  1. #foo
                                                                                  +
                                                                                  1. :foo
                                                                                  +
                                                                                  1. ;foo
                                                                                  + +!! wikitext +**foo *#foo @@ -21157,20 +22262,19 @@ Lists: 1. Nested inside html #:foo #;foo -!! html -
                                                                                  • *foo
                                                                                  -
                                                                                  • #foo
                                                                                  -
                                                                                  • :foo
                                                                                  -
                                                                                  • ;foo
                                                                                  -
                                                                                  1. *foo
                                                                                  -
                                                                                  1. #foo
                                                                                  -
                                                                                  1. :foo
                                                                                  -
                                                                                  1. ;foo
                                                                                  - !!end !! test Lists: 2. Inside definition lists +!! options +parsoid=html2wt +!! html/parsoid +
                                                                                  ;foo
                                                                                  +
                                                                                  :foo
                                                                                  +
                                                                                  :foo
                                                                                  +
                                                                                  bar
                                                                                  +
                                                                                  :foo
                                                                                  + !! wikitext ;;foo @@ -21180,40 +22284,27 @@ Lists: 2. Inside definition lists :bar ::foo -!! html -
                                                                                  ;foo
                                                                                  -
                                                                                  :foo
                                                                                  -
                                                                                  :foo
                                                                                  -
                                                                                  bar
                                                                                  -
                                                                                  :foo
                                                                                  - !!end !! test Lists: 3. Only bullets at start of text should be escaped +!! options +parsoid=html2wt +!! html/parsoid +
                                                                                  • *foo*bar
                                                                                  +
                                                                                  • *fooit*bar
                                                                                  + !! wikitext **foo*bar **foo''it''*bar -!! html -
                                                                                  • *foo*bar
                                                                                  -
                                                                                  • *fooit*bar
                                                                                  - !!end !! test Lists: 4. No escapes needed !! options -parsoid -!! wikitext -*foo*bar - -*''foo''*bar - -*[[Foo]]: bar - -*[[Foo]]*bar -!! html +parsoid=html2wt +!! html/parsoid
                                                                                  • foo*bar
                                                                                  • @@ -21230,10 +22321,29 @@ parsoid
                                                                                  • Foo*bar
                                                                                  +!! wikitext +*foo*bar + +*''foo''*bar + +*[[Foo]]: bar + +*[[Foo]]*bar !!end !! test Lists: 5. No unnecessary escapes +!! options +parsoid=html2wt +!! html/parsoid +
                                                                                  • bar [[foo]]
                                                                                  +
                                                                                  • =bar [[foo]]
                                                                                  +
                                                                                  • [[bar [[foo]]
                                                                                  +
                                                                                  • ]]bar [[foo]]
                                                                                  +
                                                                                  • =bar foo]]=
                                                                                  +
                                                                                  • : a
                                                                                  +
                                                                                  • * foo
                                                                                  + !! wikitext * bar [[foo]] @@ -21248,22 +22358,13 @@ Lists: 5. No unnecessary escapes * : a * ''* foo'' -!! html -
                                                                                  • bar [[foo]]
                                                                                  -
                                                                                  • =bar [[foo]]
                                                                                  -
                                                                                  • [[bar [[foo]]
                                                                                  -
                                                                                  • ]]bar [[foo]]
                                                                                  -
                                                                                  • =bar foo]]=
                                                                                  -
                                                                                  • : a
                                                                                  -
                                                                                  • * foo
                                                                                  - !!end !! test Lists: 6. Escape bullets in SOL position !! options parsoid=html2wt -!! html +!! html/parsoid

                                                                                  *foo

                                                                                  !! wikitext *foo @@ -21271,20 +22372,22 @@ parsoid=html2wt !! test Lists: 7. Escape bullets in a multi-line context -!! wikitext -a -*b -!! html +!! options +parsoid=html2wt +!! html/parsoid

                                                                                  a *b

                                                                                  +!! wikitext +a +*b !!end !! test Lists: 8. Escape colons only if not present in tags !! options parsoid=html2wt -!! html +!! html/parsoid
                                                                                  a:bc:d
                                                                                  !! wikitext ; a:b''c:d'' @@ -21296,17 +22399,16 @@ parsoid=html2wt !! test HRs: 1. Single line +!! options +parsoid=html2wt +!! html/parsoid +
                                                                                  ---- +
                                                                                  =foo= +
                                                                                  *foo !! wikitext -------- ----=foo= ----*foo -!! html+tidy -
                                                                                  -

                                                                                  ----

                                                                                  -
                                                                                  -

                                                                                  =foo=

                                                                                  -
                                                                                  -

                                                                                  *foo

                                                                                  !! end #### --------------- Tables --------------- @@ -21330,40 +22432,48 @@ HRs: 1. Single line !! test Tables: 1a. Simple example -!! wikitext -{| -|} -!! html +!! options +parsoid=html2wt +!! html/parsoid

                                                                                  {| |}

                                                                                  +!! wikitext +{| +|} !! end !! test Tables: 1b. No escaping needed -!! wikitext -!foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

                                                                                  !foo

                                                                                  +!! wikitext +!foo !! end !! test Tables: 1c. No escaping needed -!! wikitext -|foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

                                                                                  |foo

                                                                                  +!! wikitext +|foo !! end !! test Tables: 1d. No escaping needed -!! wikitext -|}foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

                                                                                  |}foo

                                                                                  +!! wikitext +|}foo !! end !! test @@ -21424,11 +22534,8 @@ parsoid=html2wt !! test Tables: 2c. Nested in td -- no escaping needed -!! wikitext -{| - -|foo!!bar -|} +!! options +parsoid=html2wt !! html/* @@ -21436,15 +22543,17 @@ Tables: 2c. Nested in td -- no escaping needed
                                                                                  foo!!bar
                                                                                  -!! end - -!! test -Tables: 3a. Nested in th !! wikitext {| -!foo!bar +|foo!!bar |} +!! end + +!! test +Tables: 3a. Nested in th +!! options +parsoid=html2wt !! html/* @@ -21452,6 +22561,11 @@ Tables: 3a. Nested in th
                                                                                  foo!bar
                                                                                  +!! wikitext +{| + +!foo!bar +|} !! end !! test @@ -21560,6 +22674,19 @@ parsoid=html2wt !! test Tables: 4c. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + + +
                                                                                  foo-barfoo+bar
                                                                                  foo-barfoo+bar
                                                                                  foo +

                                                                                  bar|baz ++bar +-bar

                                                                                  x +
                                                                                  a|b
                                                                                  !! wikitext {| |foo-bar @@ -21600,21 +22727,18 @@ bar|baz
                                                                                  a|b
                                                                                  -!! html/parsoid - - - - - -
                                                                                  foo-barfoo+bar
                                                                                  foo-barfoo+bar
                                                                                  foo -

                                                                                  bar|baz -+bar --bar

                                                                                  x -
                                                                                  a|b
                                                                                  !! end !! test Tables: 4d. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + +
                                                                                  Foo-bar+1-2
                                                                                  !! wikitext {| |[[Foo]]-bar @@ -21631,29 +22755,42 @@ Tables: 4d. No escaping needed -2 +!! end + +!! test +T97430: Don't emit empty nowiki pairs around marker meta tags +!! options +parsoid=html2wt !! html/parsoid - - - - -
                                                                                  Foo-bar+1-2
                                                                                  +

                                                                                  *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 + + + +
                                                                                  <foo bar>
                                                                                  !! wikitext -{| || |} ++ -|- || || ++ -- -|- > [ +{| +| |} -!! html +!! html/php - - - -
                                                                                  + + <foo + + bar> + + !! end #### --------------- Links ---------------- @@ -21665,6 +22802,12 @@ parsoid=wt2html #### -------------------------------------- !! test Links 1. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

                                                                                  Fooboo +[Foobar] +x [Foobar] x

                                                                                  !! wikitext [[Foo|Foo''boo'']] [[Foo|[Foobar]]] @@ -21674,10 +22817,6 @@ Links 1. WikiLinks: No escapes needed [Foobar] x [Foobar] x

                                                                                  -!! html/parsoid -

                                                                                  Fooboo -[Foobar] -x [Foobar] x

                                                                                  !! end !! test @@ -21722,6 +22861,11 @@ parsoid=html2wt !! test Links 3. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

                                                                                  [Foobar +foo|bar

                                                                                  !! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] @@ -21729,9 +22873,6 @@ Links 3. WikiLinks: No escapes needed

                                                                                  [Foobar foo|bar

                                                                                  -!! html/parsoid -

                                                                                  [Foobar -foo|bar

                                                                                  !! end !! test @@ -21761,18 +22902,22 @@ parsoid=html2wt !! test Links 5. ExtLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

                                                                                  [google

                                                                                  !! wikitext [http://google.com [google] !! html/php

                                                                                  [google

                                                                                  -!! html/parsoid -

                                                                                  [google

                                                                                  !! 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

                                                                                  http://example.com.,;:!?\ -http://example.com:

                                                                                  @@ -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 -

                                                                                  ISBN 12345678901 -ISBN 1234567890x -aISBN 1234567890b +

                                                                                  ISBN 12345678901 +ISBN 1234567890x +aISBN 1234567890b

                                                                                  !! wikitext ISBN 12345678901 @@ -21925,8 +23084,10 @@ aISBN 1234567890b !! test Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid -

                                                                                  -ISBN 1234567890's +

                                                                                  -ISBN 1234567890's !! wikitext -ISBN 1234567890's !! html/php @@ -21942,20 +23103,21 @@ parsoid=html2wt

                                                                                  this is not a link: http://example.com

                                                                                  !! 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 +

                                                                                  Söfnuður-00

                                                                                  !! wikitext [[Söfnuður]]-[[00]] !! html/php

                                                                                  Söfnuður-00

                                                                                  -!! html/parsoid -

                                                                                  Söfnuður-00

                                                                                  !! end #### --------------- Quotes --------------- @@ -21967,28 +23129,7 @@ language=is !! test 1a. Quotes inside and !! options -parsoid=html2wt,wt2wt -!! 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'' +parsoid=html2wt !! html/*

                                                                                  '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
                                                                                  test
                                                                                  +'foo and
                                                                                  bar +
                                                                                    +
                                                                                  1. test
                                                                                  2. +
                                                                                  !! wikitext '''a'' foo ''[[bar]]'' ''a''' foo ''[[bar]]'' @@ -22026,56 +23199,49 @@ parsoid=html2wt,wt2wt '''foo''
                                                                                  test
                                                                                  '''foo'' and
                                                                                  bar -!! html -'a foo bar -a' foo bar -a' foo bar -foo x'bar -'foo [1] -'foo
                                                                                  test
                                                                                  -'foo and
                                                                                  bar -
                                                                                    -
                                                                                  1. test
                                                                                  2. -
                                                                                  !! 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 +

                                                                                  foo [1]

                                                                                  +
                                                                                    +
                                                                                  1. a + b
                                                                                  2. +
                                                                                  !! wikitext foo ''a'' b -!! html -

                                                                                  foo [1]

                                                                                  -
                                                                                    -
                                                                                  1. a - b
                                                                                  2. -
                                                                                  !! 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 foo bar 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

                                                                                  x x

                                                                                  @@ -22734,12 +23961,10 @@ parsoid !!test Encapsulate protected attributes from wt -!!options -parsoid !! wikitext -
                                                                                  foo
                                                                                  -!! html -
                                                                                  foo
                                                                                  +
                                                                                  foo
                                                                                  +!! html/parsoid +
                                                                                  foo
                                                                                  !!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

              || ||

              @@ -22791,7 +24016,7 @@ Encapsulation properly handles null DSR information from foster box parsoid=wt2html,wt2wt !! wikitext {{echo|
              a
              foo
              bar
              }} -!! html +!! html/parsoid foo
              bar
              !!end @@ -22801,7 +24026,7 @@ parsoid=wt2html,wt2wt parsoid=wt2wt,wt2html !! wikitext {{echo|foo}}
              bar
              -!! html +!! html/parsoid

              foo

              @@ -22817,7 +24042,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
              {{echo|foo}}
              bar
              -!! html +!! html/parsoid
              foo
              @@ -22834,7 +24059,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext

              {{echo|foo

              }}bar
              -!! html +!! html/parsoid

              foo

              @@ -22853,7 +24078,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext

              {{echo|foo

              }}bar
              -!! html +!! html/parsoid

              foo

              @@ -22872,7 +24097,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext foo}}

              {{echo|foo

              -!! html +!! html/parsoid

              foo

              @@ -22893,7 +24118,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
              foo

              {{echo|foo

              }}

              ok

              -!! html +!! html/parsoid

              foo

              @@ -22915,7 +24140,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
              {{echo|

              foo

              }}
              bar
              -!! html +!! html/parsoid

              foo

              @@ -22926,6 +24151,8 @@ parsoid=wt2wt,wt2html
              !!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 -

              a

              {{{1}}}

              +!! html/parsoid +

              a

              + +

              {{{1}}}

              +
              @@ -22952,7 +24182,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
              b
              {{echo|hi
              hello}} -!! html +!! html/parsoid

              hi

              hello

              !!end @@ -22967,7 +24197,7 @@ parsoid=wt2html,wt2wt |}
              |} -!! html +!! html/parsoid
              @@ -22995,7 +24225,7 @@ Properly encapsulate empty-content transclusions in fosterable positions Support element with .data attribute !!options parsoid=html2wt -!! html +!! html/parsoid !! wikitext @@ -23024,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

              Foo

              !! wikitext [[Foo]] @@ -23035,7 +24265,7 @@ parsoid=html2wt New wikilinks should be serialized properly !! options parsoid=html2wt -!! html +!! html/parsoid Foo Foo !! wikitext @@ -23047,7 +24277,7 @@ parsoid=html2wt New wiki links (href variations) !! options parsoid=html2wt -!! html +!! html/parsoid Foo_bar Foo_bar Foo_bar @@ -23063,7 +24293,7 @@ parsoid=html2wt New wiki links (content string variations) !! options parsoid=html2wt -!! html +!! html/parsoid Foo_bar Foo bar ./Foo_bar @@ -23077,7 +24307,7 @@ parsoid=html2wt New category links (href variations) !! options parsoid=html2wt -!! html +!! html/parsoid @@ -23092,7 +24322,7 @@ New sol transparent links don't need indent-pre nowiki protection !! options parsoid=html2wt language=de -!! html +!! html/parsoid @@ -23106,7 +24336,7 @@ language=de New interlanguage links (href variations) !! options parsoid=html2wt -!! html +!! html/parsoid @@ -23253,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 @@ -23272,7 +24503,7 @@ Image: Block level image should have \n before and after 456 !! html/parsoid

              123

              -
              +

              456

              !!end @@ -23290,26 +24521,22 @@ Image: New block level image should have \n before and after (existing content) !! test Image: upright option (parsoid) -!! options -parsoid !! wikitext [[File:Foobar.jpg|thumb|upright|caption]] [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] -!! html -
              caption
              -
              caption
              -
              caption
              +!! html/parsoid +
              caption
              +
              caption
              +
              caption
              !!end !! test Image: upright option is ignored on inline and frame images (parsoid) -!! options -parsoid !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] -!! html -

              +!! html/parsoid +

              !!end !! test @@ -23358,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

              @@ -23370,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 @@ -23380,7 +24607,7 @@ parsoid=html2wt Don't strip leading whitespace when handling indent-pre suppressing tags !! options parsoid=html2wt -!! html +!! html/parsoid
              indented row
              @@ -23413,55 +24640,39 @@ foo Nowiki-wrap leading whitespace when handling indent-pre inducing tags !! options parsoid=html2wt -!! wikitext -foo - bar +!! html/parsoid +

              foo

              + bar foo2 - bar2 + bar2
              foo
              - bar + bar
              - foo + foo
              -!! html -

              foo

              - bar +!! wikitext +foo + bar foo2 - bar2 + bar2
              foo
              - bar + bar
              - foo + foo
              !! end -!! test -Lists: Add space after bullets -!! options -parsoid=html2wt -!! html -
                -
              • foo
              • -
              • bar
              • -
              • baz
              • -
              -!! wikitext -* foo -* bar -* baz -!! end - !! test Lists: Dont insert newlines in a serialized list item. !! options parsoid=html2wt -!! html +!! html/parsoid
              • a
                b
              • c
              !! wikitext * a
              b @@ -23469,49 +24680,106 @@ parsoid=html2wt !! end !! test -Headings: Add space before/after == (Bug 51744) +1. Headings: Force sol-transparent links and behavior switches to serialize before/after !! options -parsoid=html2wt -!! html -

              foo

              -

              bar

              -

              baz

              -

              baz

              +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html/parsoid +

              hello there

              +

              hi pal

              + +

              how goes it

              +

              it goes well

              + +

              howdy

              + +

              ok

              !! wikitext -== foo == +== hello there [[Category:A1]] == -== bar == +== [[Category:A2]] hi pal == -== baz == +== [[Category:A3]] how goes it == -== baz == +== it goes well [[Category:A4]] == + +==howdy [[Category:A5]] == + +== __TOC__ ok == !! end !! test -Headings: Force metas to serialize before/after +2. Headings: Force sol-transparent links and behavior switches to serialize before/after !! options -parsoid=html2wt -!! html -

              hello there

              -

              hi pal

              +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

              hello there

              +

              hi pal

              + +

              how goes it

              +

              it goes well

              -

              how goes it

              +

              ok

              !! wikitext == hello there == [[Category:A1]] - [[Category:A2]] + == hi pal == [[Category:A3]] + == how goes it == + +== it goes well == +[[Category:A4]] + +__TOC__ + +== ok == +!! end + +!! test +Headings: Don't hoist metas that come from templates +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

              foo

              +!! wikitext +== {{echo|foo [[Category:Foo]]}} == +!! end + +!! test +Headings: Category in ref isn't hoisted +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

              foo [1]

              + +
              1. bar
              +!! wikitext +== foo bar +[[Category:Baz]] == + + !! end !! test Parsoid: Serialize positional parameters with = in them as named parameter !! options parsoid=html2wt -!! html +!! html/parsoid

              foo

              @@ -23535,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

              http://stuff?is=ok

              !! wikitext {{echo|1 = http://stuff?is=ok}} @@ -23545,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

              @@ -23570,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]] @@ -23580,27 +24848,89 @@ parsoid=html2wt Enforce single-line context in the serializer !! options parsoid=html2wt -!! html +!! html/parsoid

              testing 123

              +

              hi there +you

              + +

              foo [1]

              + +
              1. hello +there
              +
              • asd sdf
              + +
              • foo +bar +baz
              • +
              • foo bar +baz
              + +
              hi +ho
              hi +ho
              + +
              + +
              ha +ha +ha
              !! wikitext == testing 123 == +== hi {{bogus|there +you}} == + +== foo hello +there == + + + * asd sdf + +* 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/parsoid +

              foo : bar

              + +

              foo : bar

              + +[1]ok

              +!! wikitext +foo : bar + +foo : bar + +foo : barok !! end -#----------------------------- -# I/B quote minimization tests -#----------------------------- + +#----------------------- +# Tag minimization tests +#----------------------- !! test 1. I/B quote minimization: wikitext-only tags should be combined !! options parsoid=html2wt -!! html +!! html/parsoid

              AB

              AB

              AB

              @@ -23631,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

              AB

              !! wikitext @@ -23644,7 +24974,7 @@ parsoid=html2wt 3. I/B quote minimization: templated content stops minimization !! options parsoid=html2wt -!! html +!! html/parsoid

              AB

              AB !! wikitext @@ -23657,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

              @@ -23699,28 +25029,71 @@ parsoid={ ''ac'' !! end -#------------------------------------ -# End of I/B quote minimization tests -#------------------------------------ - -!!test -Bug 54262: New entities +!! test +1. Merge adjacent link nodes as long as at least one element is new !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +Football +Football +Football !! wikitext -  -!! html -  +[[Football]] +[[Football]] +[[Football|Foot]][[Football|ball]] !! end -## Note that there is no wikitext output for 'unknownproperty' ## -## Unknown magic words are silently dropped ## - !! test -Magic words +2. Merge adjacent link nodes and enable additional normalizations +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +Football +!! wikitext +[[Football|''Football'']] +!! end + +!! test +3. Don't merge adjacent link nodes if scrubWikitext is false +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html/parsoid +Football +!! wikitext +[[Football|Foot]][[Football|ball]] +!! end + +#------------------------------ +# End of tag minimization tests +#------------------------------ + +!!test +Bug 54262: New entities !! options parsoid=html2wt -!! html +!! html/parsoid +  +!! wikitext +  +!! end + +## Note that there is no wikitext output for 'unknownproperty' ## +## Unknown magic words are silently dropped ## + +!! test +Magic words +!! options +parsoid=html2wt +!! html/parsoid @@ -23747,7 +25120,7 @@ __NOCONTENTCONVERT__ Consecutive
              s should not get merged
               !! options
               parsoid=html2wt,html2html
              -!! html
              +!! html/parsoid
               
              a
              b
              c
              @@ -23779,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 @@ -23789,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] @@ -23799,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] @@ -23855,11 +25228,132 @@ xhttp://cscott.netx xhttp://cscott.netx !! end +!! test +WTS of edited autolink-like text (T103364) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "span[typeof]", "removeAttr", "typeof" ] + ] +} +!! wikitext +Not a link: http://example.com. +!! wikitext/edited +Not a link: http://example.com. +!! end + +!! test +WTS of newly-authored autolink-like text (T103364) +!! options +parsoid=html2wt +!! html/parsoid +

              http://example.com is not a link.

              +!! wikitext +http://example.com is not a link. +!! end + +!! test +WTS of autolink-like text after an autolink (T108563) +!! options +parsoid=html2wt +!! html/parsoid +

              http://example.com http://example.com is not a link.

              +!! wikitext +http://example.com http://example.com is not a link. +!! end + +!! test +Magic links inside links (not autolinked) +!! wikitext +[[Foo|http://example.com]] +[[Foo|RFC 1234]] +[[Foo|PMID 1234]] +[[Foo|ISBN 123456789x]] + +[http://foo.com http://example.com] +[http://foo.com RFC 1234] +[http://foo.com PMID 1234] +[http://foo.com ISBN 123456789x] +!! html+tidy +

              http://example.com RFC 1234 PMID 1234 ISBN 123456789x

              +

              http://example.com RFC 1234 PMID 1234 ISBN 123456789x

              +!! html/parsoid +

              http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x

              + +

              http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x

              +!! end + +!! test +Magic links inside image captions (autolinked) +!! wikitext +[[File:Foobar.jpg|thumb|http://example.com]] +[[File:Foobar.jpg|thumb|RFC 1234]] +[[File:Foobar.jpg|thumb|PMID 1234]] +[[File:Foobar.jpg|thumb|ISBN 123456789x]] +!! html+tidy +
              + +
              +
              +
              + +
              +
              +
              +
              + +
              +
              +
              + +
              +!! html/parsoid +
              http://example.com
              +
              RFC 1234
              +
              PMID 1234
              +
              ISBN 123456789x
              +!! end + +!! test +WTS of magic word text (T109371) +!! options +parsoid=html2wt +!! html/parsoid +

              RFC 1234

              +

              RFC 1234

              +

              RFC 1234

              +!! 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 +!! html/parsoid !! wikitext #REDIRECT [[Bar]] @@ -23869,7 +25363,7 @@ parsoid=html2wt T75121: Infer extension name from typeOf if data-mw is not present !! options parsoid=html2wt -!! html +!! html/parsoid
              !! wikitext @@ -23929,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 @@ -23945,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
              @@ -23972,67 +25466,708 @@ parsoid={ Never serialize a-tag as html, regardless of what data-parsoid has to say !! options parsoid=html2wt -!! html +!! html/parsoid Foo !! wikitext [[Foo]] !! end -# ----------------------------------------------------------------- -# End of section for Parsoid-only html2wt tests for serialization -# of new content -# ----------------------------------------------------------------- +## SSS FIXME: This is broken output nevertheless. +## What might be a reasonable non-broken output for this? +## This is an edge case unlikely to be seen in production +## that I am not wasting more time on this right now. +!! test +Never serialize a-tag as html, no matter what attributes it has +!! options +parsoid=html2wt +!! html/parsoid + +!! wikitext +[http://boo.org http://boohoo.org] +!! end -# ----------------------------------------------------------------- -# The following section of tests are primarily to spec behavior of -# the selective serializer. All these tests have manual selser -# changes. The automated selser changes for all tests handle the -# wide variation of changes, but these tests here capture specs -# deterministically. -# ---------------------------------------------------------------- +# 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 +

              one two three

              +!! wikitext +[http://test.com][[one]] two three +!! end + +# -------------------------------------------- +# Tests spec'ing wikitext serialization norms | +# -------------------------------------------- + +!! test +Lists: Add space after bullets +!! options +parsoid=html2wt +!! html/parsoid +
                +
              • foo
              • +
              • bar
              • +
              • baz
              • +
              +!! wikitext +* foo +* bar +* baz +!! end + +!! test +1. Headings: Add space before/after == (T53744) +!! options +parsoid=html2wt +!! html/parsoid +

              foo

              +

              bar

              +

              baz

              +

              baz

              +!! wikitext +== foo == + +== bar == + +== baz == + +== baz == +!! end + +!! test +2. Headings: Add space before/after == even after hoisted content +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

              ok

              +!! wikitext + [[Category:A2]] + +== ok == +!! end + +!! test +1. Headings: suppress newly created empty headings +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

              +!! wikitext +!! end + +!! test +2. Headings: don't suppress empty headings if scrubWikitext is false +!! options +parsoid=html2wt +!! html/parsoid +

              +!! wikitext +==== +!! end -## T90517 !! test -1. Selser: New comments should not be lost +3. Headings: suppress empty headings on edits !! options parsoid={ "modes": ["selser"], + "scrubWikitext": true, "changes": [ - [ "#a", "after", "" ], - [ "#b", "before", "" ] + [ "#x", "remove"] ] } !! wikitext -a - -b +==foo== !! wikitext/edited -a +!! end -b +!! test +1. WT Quote Tags: suppress newly created empty style tags +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid + +!! wikitext +!! end + +!! test +2. WT Quote Tags: don't suppress empty style tags if scrubWikitext is false +!! options +parsoid=html2wt +!! html/parsoid + +!! wikitext +'''''''''' !! end -## T89383 !! test -2. Selser: Check for validity of DSR before using it +3. WT Quote Tags: suppress empty style tags on edits !! options parsoid={ "modes": ["selser"], + "scrubWikitext": true, "changes": [ - [ "#a", "before", "" ] + [ "#x", "remove"] ] } !! wikitext -a +'''foo''' !! wikitext/edited -{{DISPLAYTITLE:foo}} -a !! end +!! test +1. Anchors: suppress newly created empty anchors +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid + +!! wikitext +!! end + +!! test +2. Anchors: don't suppress empty anchors if scrubWikitext is false +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html/parsoid + +!! wikitext +[[Test|]] +!! end -TODO: -more images -more tables -character entities -and much more -Try for 100% code coverage +!! test +3. Anchors: suppress empty anchors on edits +!! options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "#x", "remove"] + ] +} +!! wikitext +[[Test|foo]] +!! wikitext/edited +!! end + +!! test +3a. Anchors: do not suppress numbered extlinks +!! options +parsoid={ + "modes": ["wt2wt"], + "scrubWikitext": true +} +!! wikitext +[http://foo.com] +!! html/parsoid + +!! end + +!! test +3b. Anchors: do not suppress numbered extlinks +!! options +parsoid={ + "modes": ["wt2wt"], + "scrubWikitext": true, + "changes": [ + [ "#x", "remove"] + ] +} +!! wikitext +[http://foo.com foo] +!! wikitext/edited +[http://foo.com] +!! end + +!!test +Normalizations should be restricted to edited content +!!options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "h1", "before", ""] + ] +} +!!wikitext +a += = +b +!!wikitext/edited +a += = +b +!!end + +!! test +1. Multiple normalizations (html2wt) +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

              +

              foo + x

              +!! wikitext + +[[foo]] +x + +!! end + +!! test +2. Multiple normalizations (selser) +!! options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "#x", "after", "

              \n

              x

              "] + ] +} +!! 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/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
              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 +

              Berlin is the capital of Germany.

              +

              Foo bar

              +

              Boston is a city.

              +!! 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 +

              Berlin is the capital of Germany.

              +

              Foo bar

              +

              Boston is a city.

              +!! 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 + +# --------------------------------------------------- +# End of tests spec'ing wikitext serialization norms | +# --------------------------------------------------- + +# ----------------------------------------------------------------- +# End of section for Parsoid-only html2wt tests for serialization +# of new content +# ----------------------------------------------------------------- + +# ----------------------------------------------------------------- +# The following section of tests are primarily to spec behavior of +# the selective serializer. All these tests have manual selser +# changes. The automated selser changes for all tests handle the +# wide variation of changes, but these tests here capture specs +# deterministically. +# ---------------------------------------------------------------- + +## T90517 +!! test +Selser: New comments should not be lost +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "after", "" ], + [ "#b", "before", "" ] + ] +} +!! wikitext +a + +b +!! wikitext/edited +a + +b +!! end + +## T89383 +!! test +Selser: Check for validity of DSR before using it +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "before", "" ] + ] +} +!! wikitext +a +!! wikitext/edited +{{DISPLAYTITLE:foo}} +a +!! end + +!! test +1. DOMDiff: Changes to content should be looked up using id +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + ["#X", "after", "bar"], + ["#Y", "after", "baz"] + ] +} +!! wikitext +X foo +Y + +foo + +!! wikitext/edited +X foobar +Y + +foobaz + +!! end + +!! test +2. DOMDiff: Changes to content should be looked up using id +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + ["#Z", "after", "bar"] + ] +} +!! wikitext +A foo bar for a +B + + + + +foo + +!! wikitext/edited +A foo bar for a +B + + + + +foobar + +!! end diff --git a/tests/parser/preprocess/All_system_messages.expected b/tests/parser/preprocess/All_system_messages.expected index 3665e3c1..57223da6 100644 --- a/tests/parser/preprocess/All_system_messages.expected +++ b/tests/parser/preprocess/All_system_messages.expected @@ -1370,12 +1370,12 @@ Message </td><td> </td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]<br> -[[MediaWiki_talk:Emailpage|Talk]] +[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]<br> +[[MediaWiki_talk:Emailuser|Talk]] </td><td> E-mail user </td><td> - + </td></tr><tr><td> [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]<br> [[MediaWiki_talk:Emailpagetext|Talk]] diff --git a/tests/parser/preprocess/All_system_messages.txt b/tests/parser/preprocess/All_system_messages.txt index c619df7b..cdc223a9 100644 --- a/tests/parser/preprocess/All_system_messages.txt +++ b/tests/parser/preprocess/All_system_messages.txt @@ -1370,12 +1370,12 @@ Message {{int:Emailmessage}} -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]
              -[[MediaWiki_talk:Emailpage|Talk]] +[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]
              +[[MediaWiki_talk:Emailuser|Talk]] E-mail user -{{int:Emailpage}} +{{int:Emailuser}} [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]
              [[MediaWiki_talk:Emailpagetext|Talk]] -- cgit v1.2.3-54-g00ecf