| 1 |
{ |
| 2 |
"1. Table tag in SOL posn. should get reparsed correctly with valid TSR": { |
| 3 |
"wt2wt": "{{1x|}}\n{| width=\"100%\"\n|foo\n|}" |
| 4 |
}, |
| 5 |
"1. Template wrapping shouldn't ignore fostered content": { |
| 6 |
"wt2wt": "\nhiho\n{|\n{{tr}}\n{{1x|\n}}\n\nhiho\n|}" |
| 7 |
}, |
| 8 |
"2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost)": { |
| 9 |
"wt2wt": "<nowiki>||</nowiki> <nowiki>||</nowiki>\n<table>\n<tr><td> a\n</table>" |
| 10 |
}, |
| 11 |
"2. Lists with start-of-line-transparent tokens before bullets: Template close": { |
| 12 |
"wt2html": "<ul about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"dsr\":[0,16,0,0],\"firstWikitextNode\":\"UL\",\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[\"*foo \",{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"bar\\n\"}},\"i\":0}}]}'><li>foo bar</li></ul><span about=\"#mwt1\">\n</span><p data-parsoid='{\"dsr\":[16,20,0,0]}'>*baz</p>" |
| 13 |
}, |
| 14 |
"2. Template wrapping shouldn't ignore fostered content": { |
| 15 |
"wt2wt": "\nhiho\n{|\n{{tr}}\n{{1x|\n }}\n\nhiho\n|}" |
| 16 |
}, |
| 17 |
"2. includeonly in html attr value": { |
| 18 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,155,0,0]}'><span id=\"v1\" about=\"#mwt1\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"id\":\"v1\"},\"sa\":{\"id\":\"<noinclude>v1</noinclude><includeonly>v2</includeonly>\"},\"dsr\":[0,76,66,7]}' data-mw='{\"attribs\":[[{\"txt\":\"id\"},{\"html\":\"<meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid='{\\\"src\\\":\\\"&lt;noinclude>\\\",\\\"dsr\\\":[10,21,null,null]}'/>v1<meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid='{\\\"src\\\":\\\"&lt;/noinclude>\\\",\\\"dsr\\\":[23,35,null,null]}'/><meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid='{\\\"dsr\\\":[35,64,null,null]}' data-mw='{\\\"src\\\":\\\"&lt;includeonly>v2&lt;/includeonly>\\\"}'/><meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid='{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[64,64,null,null]}'/>\"}]]}'>bar</span>\n<span id='\"v1\"' about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"id\":\"\\\"v1\\\"\"},\"sa\":{\"id\":\"<noinclude>\\\"v1\\\"</noinclude><includeonly>\\\"v2\\\"</includeonly>\"},\"dsr\":[77,155,68,7]}' data-mw='{\"attribs\":[[{\"txt\":\"id\"},{\"html\":\"<meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid='{\\\"src\\\":\\\"&lt;noinclude>\\\",\\\"dsr\\\":[86,97,null,null]}'/>\\\"v1\\\"<meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid='{\\\"src\\\":\\\"&lt;/noinclude>\\\",\\\"dsr\\\":[101,113,null,null]}'/><meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid='{\\\"dsr\\\":[113,144,null,null]}' data-mw='{\\\"src\\\":\\\"&lt;includeonly>\\\\\\\"v2\\\\\\\"&lt;/includeonly>\\\"}'/><meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid='{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[144,144,null,null]}'/>\"}]]}'>bar</span></p>", |
| 19 |
"wt2wt": "<span id=\"<noinclude>v1</noinclude><includeonly>v2</includeonly>\">bar</span>\n<span id=\"<noinclude>"v1"</noinclude><includeonly>"v2"</includeonly>\">bar</span>" |
| 20 |
}, |
| 21 |
"4. includeonly in table attributes": { |
| 22 |
"wt2html": "<table data-parsoid='{\"dsr\":[0,77,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,75,0,0]}'><tr about=\"#mwt1\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"startTagSrc\":\"|-\",\"a\":{\"<noinclude>\\n|-\\n|a\\n</noinclude>\":null},\"sa\":{\"<noinclude>\\n|-\\n|a\\n</noinclude>\":\"\"},\"dsr\":[3,36,33,0]}' data-mw='{\"attribs\":[[{\"txt\":\"a\",\"html\":\"<meta typeof=\\\"mw:Includes/NoInclude\\\" data-parsoid='{\\\"src\\\":\\\"&lt;noinclude>\\\",\\\"dsr\\\":[6,17,null,null]}'/>\\n|-\\n|a\\n<meta typeof=\\\"mw:Includes/NoInclude/End\\\" data-parsoid='{\\\"src\\\":\\\"&lt;/noinclude>\\\",\\\"dsr\\\":[24,36,null,null]}'/>\"},{\"html\":\"\"}]]}'></tr>\n<tr about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"startTagSrc\":\"|-\",\"a\":{\"<includeonly>\\n|-\\n|b\\n</includeonly>\":null},\"sa\":{\"<includeonly>\\n|-\\n|b\\n</includeonly>\":\"\"},\"dsr\":[37,74,37,0]}' data-mw='{\"attribs\":[[{\"txt\":\"\",\"html\":\"<meta typeof=\\\"mw:Includes/IncludeOnly\\\" data-parsoid='{\\\"dsr\\\":[40,74,null,null]}' data-mw='{\\\"src\\\":\\\"&lt;includeonly>\\\\n|-\\\\n|b\\\\n&lt;/includeonly>\\\"}'/><meta typeof=\\\"mw:Includes/IncludeOnly/End\\\" data-parsoid='{\\\"src\\\":\\\"\\\",\\\"dsr\\\":[74,74,null,null]}'/>\"},{\"html\":\"\"}]]}'></tr>\n</tbody></table>" |
| 23 |
}, |
| 24 |
"8. Encapsulate foster-parented transclusion content": { |
| 25 |
"wt2wt": "{{1x|a\n}}\n{|{{1x|style='color:red'}}\n|-\n|b\n|}\n" |
| 26 |
}, |
| 27 |
"<pre> inside a link": { |
| 28 |
"wt2wt": "[[Main<pre> Page</pre>]] [[Main Page|the main page]]<pre>[it's not very good]</pre>" |
| 29 |
}, |
| 30 |
"Anchor containing a #. (T65430)": { |
| 31 |
"metadata": "" |
| 32 |
}, |
| 33 |
"Attribute test: unquoted but illegal value (hash)": { |
| 34 |
"wt2wt": "<font color=\"#x\">foo</font>" |
| 35 |
}, |
| 36 |
"Bail on table cell attribute parsing on wikilink": { |
| 37 |
"wt2wt": "{|\n|testing [[one|two]]<nowiki> |three</nowiki>||four\n| testing one two |three||four\n|testing=\"[[one|two]]<nowiki>\" |three</nowiki>||four\n|}" |
| 38 |
}, |
| 39 |
"Broken link with fragment": { |
| 40 |
"metadata": "" |
| 41 |
}, |
| 42 |
"Category with newline in sort key": { |
| 43 |
"metadata": "cat=Wikidata:Tools sort=*" |
| 44 |
}, |
| 45 |
"DIV IN UPPERCASE": { |
| 46 |
"wt2wt": "<DIV id=\"x\">HTML ROCKS</DIV>" |
| 47 |
}, |
| 48 |
"Don't break on | in extension attribute in template": { |
| 49 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,33,0,0]}'><span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,33,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"<tag name=\\\"hi|ho\\\">ha</tag>\"}},\"i\":0}}]}'>ho\">ha</tag></span></p>" |
| 50 |
}, |
| 51 |
"Don't fall for the self-closing div": { |
| 52 |
"wt2wt": "<div>hello world</div>" |
| 53 |
}, |
| 54 |
"Empty LI (T49673)": { |
| 55 |
"wt2wt": "*a\n*\n*\n*b" |
| 56 |
}, |
| 57 |
"Empty TD followed by TD with tpl-generated attribute": { |
| 58 |
"wt2wt": "{|\n|-\n|\n| {{1x|style='color:red'}} |foo\n|}" |
| 59 |
}, |
| 60 |
"Empty attribute crash test single-quotes (T4067)": { |
| 61 |
"wt2wt": "<font color=\"\">foo</font>" |
| 62 |
}, |
| 63 |
"Empty table rows go away": { |
| 64 |
"wt2html": "<table data-parsoid='{\"dsr\":[0,37,2,2]}'>\n<tbody data-parsoid='{\"dsr\":[3,35,0,0]}'><tr data-parsoid='{\"autoInsertedStart\":true,\"dsr\":[3,16,0,0]}'><td data-parsoid='{\"dsr\":[3,9,1,0]}'>Hello</td>\n<td data-parsoid='{\"dsr\":[10,16,1,0]}'>there</td></tr>\n<tr class=\"foo\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[17,31,14,0]}'></tr>\n<tr class=\"mw-empty-elt\" data-parsoid='{\"startTagSrc\":\"|-\",\"dsr\":[32,34,2,0]}'></tr>\n</tbody></table>" |
| 65 |
}, |
| 66 |
"Fuzz testing: Parser13": { |
| 67 |
"wt2wt": "{| \n| http: / a |\n|}" |
| 68 |
}, |
| 69 |
"Fuzz testing: Parser16": { |
| 70 |
"wt2wt": "{|\n!https://|| || ||\n|}" |
| 71 |
}, |
| 72 |
"Fuzz testing: Parser21": { |
| 73 |
"wt2wt": "{|\n!irc://{{ftp://a\" onmouseover=\"alert('hello world');\"\n|\n|}" |
| 74 |
}, |
| 75 |
"Fuzz testing: Parser22": { |
| 76 |
"wt2wt": "http://===r:::https://b\n\n{|\n|}" |
| 77 |
}, |
| 78 |
"HTML multiple attributes correction": { |
| 79 |
"wt2wt": "<p class=\"awesome\">Awesome!</p>" |
| 80 |
}, |
| 81 |
"Handling html with a br self-closing tag": { |
| 82 |
"wt2wt": "<br title=\"\" />\n<br title=\"\" />\n<br title=\"\">\n<br title=\"bar\" />\n<br title=\"bar\" />\n<br title=\"bar/\">" |
| 83 |
}, |
| 84 |
"Handling html with a div self-closing tag": { |
| 85 |
"wt2html": "<div title=\"\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[0,13,13,0]}'></div>\n<div title=\"\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[14,26,12,0]}'></div>\n<div title=\"\" data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[27,93,13,0]}'>\n<div title=\"bar\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[41,58,17,0]}'></div>\n<div title=\"bar\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[59,75,16,0]}'></div>\n<div title=\"bar/\" data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[76,93,17,0]}'></div></div>", |
| 86 |
"wt2wt": "<div title=\"\" />\n<div title=\"\" />\n<div title=\"\">\n<div title=\"bar\" />\n<div title=\"bar\" />\n<div title=\"bar/\">" |
| 87 |
}, |
| 88 |
"Horizontal ruler (should it add that extra space?)": { |
| 89 |
"wt2wt": "<hr>\n<hr>\nfoo <hr> bar" |
| 90 |
}, |
| 91 |
"Ignore pipe between table row attributes": { |
| 92 |
"wt2wt": "{|\n|quux\n|- id=\"foo\" style=\"color: red\" |\n|bar\n|}" |
| 93 |
}, |
| 94 |
"Inline HTML vs wiki block nesting": { |
| 95 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,17,0,0]}'><b data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[0,17,3,0]}'>Bold paragraph</b></p><b data-parsoid='{\"stx\":\"html\",\"autoInsertedStart\":true,\"autoInsertedEnd\":true,\"dsr\":[17,37,0,0]}'>\n\n<p data-parsoid='{\"dsr\":[19,37,0,0]}'>New wiki paragraph</p></b>" |
| 96 |
}, |
| 97 |
"Inline wiki vs wiki block nesting": { |
| 98 |
"wt2wt": "'''Bold paragraph'''\n\nNew wiki paragraph" |
| 99 |
}, |
| 100 |
"Media link redirect": { |
| 101 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a rel=\"mw:MediaLink\" href=\"http://example.com/images/3/3a/Foobar.jpg\" resource=\"./Media:Redirect_to_foobar.jpg\" title=\"Foobar.jpg\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"resource\":\"./Media:Redirect_to_foobar.jpg\"},\"sa\":{\"resource\":\"Media:Redirect to foobar.jpg\"},\"dsr\":[0,32,2,2]}'>Media:Redirect to foobar.jpg</a></p>" |
| 102 |
}, |
| 103 |
"Mixing markup for italics and bold": { |
| 104 |
"wt2wt": "'<nowiki/>''bold'<nowiki/>'''''bold''bolditalics'''''" |
| 105 |
}, |
| 106 |
"Nested lists 3 (first element empty)": { |
| 107 |
"wt2wt": "\n**bar\n" |
| 108 |
}, |
| 109 |
"Nested lists 6 (both elements empty)": { |
| 110 |
"wt2wt": "\n**\n" |
| 111 |
}, |
| 112 |
"Non-word characters don't terminate tag names (T19663, T42670, T54022)": { |
| 113 |
"wt2wt": "<blockquote|>a\n\n<b→> doesn't terminate </b→>\n\n<bä> doesn't terminate </bä>\n\n<boo> doesn't terminate </boo>\n\n<s.foo> doesn't terminate </s.foo>\n\n<sub-ID#1>" |
| 114 |
}, |
| 115 |
"Parsing of overlapping (improperly nested) inline html tags": { |
| 116 |
"wt2wt": "<span><s>x</span>" |
| 117 |
}, |
| 118 |
"Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved": { |
| 119 |
"wt2wt": "[[Foo| bar]]\n\n[[Foo| ''bar'']]\n\n[http://wp.org foo]\n\n[http://wp.org ''foo'']" |
| 120 |
}, |
| 121 |
"Render invalid page names as plain text (T53090)": { |
| 122 |
"wt2wt": "[[./../foo|bar]]\n[[foo�|bar]]\n[[foo/.|bar]]\n[[foo/..|bar]]\n<nowiki>[[foo~~~bar]]</nowiki>\n[[foo>bar]]\n[[foo[bar]]\n[[.]]\n[[..]]\n[[foo././bar]]\n[[foo[http://example.com]xyz]]\n\n[[{{1x|./../foo}}|bar]]\n[[{{1x|foo/.}}|bar]]\n[[{{1x|foo/..}}|bar]]\n[[{{1x|foo~~~~bar}}]]\n[[{{1x|foo>bar}}]]\n[[{{1x|foo././bar}}]]\n[[{{1x|foo{bar}}]]\n[[{{1x|foo}bar}}]]\n[[{{1x|foo[bar}}]]\n[[{{1x|foo]bar}}]]\n[[{{1x|foo<bar}}]]" |
| 123 |
}, |
| 124 |
"Sanitizer: Validating that <meta> and <link> work, but only for Microdata": { |
| 125 |
"wt2html": "<div itemscope=\"\" data-parsoid='{\"stx\":\"html\",\"dsr\":[0,308,15,6]}'>\n\t<p data-parsoid='{\"dsr\":[17,301,0,0]}'><meta itemprop=\"hello\" content=\"world\">\n\t<meta http-equiv=\"refresh\" content=\"5\">\n\t<meta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\">\n\t<link itemprop=\"hello\" href=\"{{SERVER}}\">\n\t<link rel=\"stylesheet\" href=\"{{SERVER}}\">\n\t<link rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\"></p>\n</div>", |
| 126 |
"wt2wt": "<div itemscope=\"\">\n\t<nowiki><meta itemprop=\"hello\" content=\"world\"></nowiki>\n\t<nowiki><meta http-equiv=\"refresh\" content=\"5\"></nowiki>\n\t<nowiki><meta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\"></nowiki>\n\t<nowiki><link itemprop=\"hello\" href=\"{{SERVER}}\"></nowiki>\n\t<nowiki><link rel=\"stylesheet\" href=\"{{SERVER}}\"></nowiki>\n\t<nowiki><link rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\"></nowiki>\n</div>" |
| 127 |
}, |
| 128 |
"Self closed html pairs (T7487)": { |
| 129 |
"wt2html": "<center data-parsoid='{\"stx\":\"html\",\"dsr\":[0,47,8,9]}'><font id=\"bug\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[8,25,17,0]}'></font>Centered text</center>\n<div data-parsoid='{\"stx\":\"html\",\"dsr\":[48,88,5,6]}'><font id=\"bug2\" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[53,71,18,0]}'></font>In div text</div>" |
| 130 |
}, |
| 131 |
"Self-closed noinclude, includeonly, onlyinclude tags": { |
| 132 |
"wt2html": "<meta typeof=\"mw:Includes/NoInclude\" data-parsoid='{\"src\":\"<noinclude />\",\"dsr\":[0,13,null,null]}'/>\n<meta typeof=\"mw:Includes/IncludeOnly\" data-parsoid='{\"dsr\":[14,29,null,null]}' data-mw='{\"src\":\"<includeonly />\"}'/>\n<meta typeof=\"mw:Includes/OnlyInclude\" data-parsoid='{\"src\":\"<onlyinclude />\",\"dsr\":[30,45,null,null]}'/>" |
| 133 |
}, |
| 134 |
"Self-closed tag with broken attribute value quoting": { |
| 135 |
"wt2html": "<div title=\"Hello world \" data-parsoid='{\"stx\":\"html\",\"selfClose\":true,\"dsr\":[0,26,26,0]}'></div><p data-parsoid='{\"dsr\":[26,29,0,0]}'>Foo</p>" |
| 136 |
}, |
| 137 |
"Special page link with fragment": { |
| 138 |
"metadata": "" |
| 139 |
}, |
| 140 |
"T192913 Regression test: 2. html2wt of links should not trip on parser functions found in target (2)": { |
| 141 |
"wt2wt": "[[Category:Bugs-{{#if:blah|Regression|None}}|<nowiki>Category:Bugs-{{#if:blah|Regression|None}}</nowiki>]]\n[[Category:Bugs-{{#if:blah|Regression|None}}-{{#if:blah|2020|None}}|<nowiki>Category:Bugs-{{#if:blah|Regression|None}}-{{#if:blah|2020|None}}</nowiki>]]" |
| 142 |
}, |
| 143 |
"T21052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links": { |
| 144 |
"wt2wt": "[http://www.example.org/ ideograms]" |
| 145 |
}, |
| 146 |
"T2529: Uncovered bullet": { |
| 147 |
"wt2wt": "*Foo{{bullet}}\n" |
| 148 |
}, |
| 149 |
"T2529: Uncovered bullet in a deeply nested list": { |
| 150 |
"wt2wt": "*******Foo\n{{bullet}}\n" |
| 151 |
}, |
| 152 |
"T2553: link with two variables in a piped link": { |
| 153 |
"wt2wt": "{|\n|[[{{{1}}}<nowiki>|</nowiki>{{{2}}}]]\n|}" |
| 154 |
}, |
| 155 |
"T368721: Closing block tags not on the stack of open elements in lists": { |
| 156 |
"wt2wt": "<!-- block tag -->*a\nb\n\n<!-- wikitext block tag -->\n*a</p>b" |
| 157 |
}, |
| 158 |
"T4095: link with pipe and three closing brackets, version 2": { |
| 159 |
"wt2wt": "[[Main Page|<nowiki>[http://example.com/]</nowiki>]]" |
| 160 |
}, |
| 161 |
"T4702: Mismatched <i>, <b> and <a> tags are invalid": { |
| 162 |
"wt2wt": "''[http://example.com text]''\n[http://example.com '''text''']\n''Something [http://example.com in italic]''\n''Something [http://example.com mixed''''', even bold''''']'''\n'''''Now [http://example.com both]'''''" |
| 163 |
}, |
| 164 |
"T73074: More fostering fun": { |
| 165 |
"wt2wt": "[[Category:Two]]\n<table><td></td></tr>{{1x|<tr>}}<!--c-->" |
| 166 |
}, |
| 167 |
"T88318: p-wrapped dash in table.": { |
| 168 |
"wt2wt": "{|\n!-\n!-\n|-\n|<nowiki>-</nowiki>\n|<nowiki>- </nowiki>\n|-\n|<small>-</small>\n|<br />\n-\n|<br />-\n|}" |
| 169 |
}, |
| 170 |
"Table attribute legitimate extension": { |
| 171 |
"wt2wt": "{|\n! style=\"<nowiki>color:blue</nowiki>\" + |status\n|}" |
| 172 |
}, |
| 173 |
"Table attribute safety": { |
| 174 |
"wt2wt": "{|\n! style=\"<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>\" + |status\n|}" |
| 175 |
}, |
| 176 |
"Table multiple attributes correction": { |
| 177 |
"wt2wt": "{|\n! class=\"awesome\" + |status\n|}" |
| 178 |
}, |
| 179 |
"Template nested in extension tag in template": { |
| 180 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,186,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,38,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"hi<span>[[ho|{{1x|hi}}]]</span>\"}},\"i\":0}}]}'>hi</span><span about=\"#mwt1\" data-parsoid='{\"stx\":\"html\"}'><a rel=\"mw:WikiLink\" href=\"./Ho\" title=\"Ho\">hi</a></span>\n<span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[39,83,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"hi<spantag>[[ho|{{1x|hi}}]]</spantag>\"}},\"i\":0}}]}'>hi</span><span typeof=\"mw:Extension/spantag\" about=\"#mwt3\" data-parsoid='{\"src\":\"<spantag>[[ho|hi]]</spantag>\"}' data-mw='{\"name\":\"spantag\",\"attrs\":{},\"body\":{\"extsrc\":\"[[ho|hi]]\"}}'><a rel=\"mw:WikiLink\" href=\"./Ho\" title=\"Ho\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Ho\"},\"sa\":{\"href\":\"ho\"}}'>hi</a></span>\n<span about=\"#mwt7\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[84,141,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"hi<spantag>[http://test.com?q={{1x|ho}}]</spantag>\"}},\"i\":0}}]}'>{{{1}}}</span>\n<span about=\"#mwt9\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[142,186,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"hi<spantag>-{ho|{{1x|hi}}}-</spantag>\"}},\"i\":0}}]}'>hi</span><span typeof=\"mw:Extension/spantag\" about=\"#mwt9\" data-parsoid='{\"src\":\"<spantag>-{ho|hi}-</spantag>\"}' data-mw='{\"name\":\"spantag\",\"attrs\":{},\"body\":{\"extsrc\":\"-{ho|hi}-\"}}'><span typeof=\"mw:LanguageVariant\" data-mw-variant='{\"filter\":{\"l\":[\"ho\"],\"t\":\"hi\"}}' data-parsoid='{\"fl\":[\"ho\"],\"src\":\"-{ho|hi}-\"}'></span></span></p>" |
| 181 |
}, |
| 182 |
"Template with argument in separate line": { |
| 183 |
"wt2wt": "{{templateasargtest |\n templ = simple }}" |
| 184 |
}, |
| 185 |
"Template with complex arguments": { |
| 186 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,106,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Template:Complextemplate\" title=\"Template:Complextemplate\" about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Template:Complextemplate\"},\"sa\":{\"href\":\"Template:complextemplate\"},\"pi\":[[{\"k\":\"param\",\"named\":true,\"spc\":[\"\\n \",\" \",\"\",\"\"]},{\"k\":\"1\"}]],\"dsr\":[0,106,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"complextemplate\",\"href\":\"./Template:Complextemplate\"},\"params\":{\"param\":{\"wt\":\"{{ templateasargtest |\\n templ = simple }}\"},\"1\":{\"wt\":\"[[Template:complextemplate|link]]\"}},\"i\":0}}]}'>link</a><span about=\"#mwt1\"> This is a test template with parameter (test)</span></p>" |
| 187 |
}, |
| 188 |
"Template with invalid target containing tags": { |
| 189 |
"wt2wt": "<nowiki>{{a</nowiki><b>b</b>|{{1x|foo}}|{{1x|a}}={{1x|b}}<nowiki>|a = b}}</nowiki>" |
| 190 |
}, |
| 191 |
"Template with invalid target containing wikilink": { |
| 192 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,17,0,0]}'>{{<a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[2,15,2,2]}'>Main Page</a>}}</p>", |
| 193 |
"wt2wt": "<nowiki>{{</nowiki>[[Main Page]]<nowiki>}}</nowiki>" |
| 194 |
}, |
| 195 |
"Templates: HTML Tables: 5. Proper fostering of categories from inside": { |
| 196 |
"wt2wt": "[[Category:foo1]]\n<table><tr><td>foo</td></tr></table>\n<!--Two categories (T52330)-->\n[[Category:bar1]]\n[[Category:bar2]]\n<table><tr><td>foo</td></tr></table>" |
| 197 |
}, |
| 198 |
"Templates: HTML Tag: 2. Generation of HTML attr. value": { |
| 199 |
"wt2html": "<div style=\"'color:red;'\" about=\"#mwt2\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"'color:red;'\"},\"sa\":{\"style\":\"{{1x|'color:red;'}}\"},\"dsr\":[0,40,31,6]}' data-mw='{\"attribs\":[[{\"txt\":\"style\"},{\"html\":\"<span about=\\\"#mwt1\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid='{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[11,30,null,null]}' data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"1x\\\",\\\"href\\\":\\\"./Template:1x\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&apos;color:red;&apos;\\\"}},\\\"i\\\":0}}]}'>'color:red;'</span>\"}]]}'>foo</div>", |
| 200 |
"wt2wt": "<div style=\"{{1x|'color:red;'}}\">foo</div>" |
| 201 |
}, |
| 202 |
"Templates: HTML Tag: 3. Generation of HTML attr key and value": { |
| 203 |
"wt2html": "<div style=\"'color:red;'\" about=\"#mwt3\" typeof=\"mw:ExpandedAttrs\" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\"'color:red;'\"},\"sa\":{\"style\":\"{{1x|'color:red;'}}\"},\"dsr\":[0,47,38,6]}' data-mw='{\"attribs\":[[{\"txt\":\"style\",\"html\":\"<span about=\\\"#mwt2\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid='{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[5,17,null,null]}' data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"1x\\\",\\\"href\\\":\\\"./Template:1x\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"style\\\"}},\\\"i\\\":0}}]}'>style</span>\"},{\"html\":\"<span about=\\\"#mwt1\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid='{\\\"pi\\\":[[{\\\"k\\\":\\\"1\\\"}]],\\\"dsr\\\":[18,37,null,null]}' data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"1x\\\",\\\"href\\\":\\\"./Template:1x\\\"},\\\"params\\\":{\\\"1\\\":{\\\"wt\\\":\\\"&apos;color:red;&apos;\\\"}},\\\"i\\\":0}}]}'>'color:red;'</span>\"}]]}'>foo</div>", |
| 204 |
"wt2wt": "<div {{1x|style}}=\"{{1x|'color:red;'}}\">foo</div>" |
| 205 |
}, |
| 206 |
"Templates: HTML Tag: 9. Multiple template-generated attributes": { |
| 207 |
"wt2wt": "<div {{1x|1=id=\"v1\" title=\"foo\"}} title=\"foo\">bar</div>" |
| 208 |
}, |
| 209 |
"Templates: Handle comments in the target": { |
| 210 |
"wt2wt": "{{1x\n<!-- should be ignored -->\n|foo}}\n\n{{1x\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n |foo}}\n\n{{1x<!-- should be ignored -->\n|foo}}\n\n{{1x<!-- should be ignored -->|foo}}\n\n{{1x|foo}}" |
| 211 |
}, |
| 212 |
"Templates: Ugly nesting: 1. Quotes opened/closed across templates (1x)": { |
| 213 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,34,0,0]}'><i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}],[{\"k\":\"1\"}],[{\"k\":\"1\"}]],\"dsr\":[0,34,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"''a\"}},\"i\":0}},{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"b''c''d\"}},\"i\":1}},{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"''e\"}},\"i\":2}}]}'>ab</i><span about=\"#mwt1\">c</span><i about=\"#mwt1\">d</i><span about=\"#mwt1\">e</span></p>" |
| 214 |
}, |
| 215 |
"Templates: Ugly templates: 4. newline-only template parameter inconsistency": { |
| 216 |
"wt2html": "<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,8,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"\\n\"}},\"i\":0}}]}'>\n</span>" |
| 217 |
}, |
| 218 |
"Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out": { |
| 219 |
"wt2wt": "{|\n|<small>foo\n\nbar\n|}\n\n{|\n|<small>foo<small>\n|}" |
| 220 |
}, |
| 221 |
"Using {{!}} in template arguments, part 2 (T290526)": { |
| 222 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,30,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Template:Main_Page?action=edit&redlink=1\" title=\"Template:Main Page\" about=\"#mwt1\" typeof=\"mw:Transclusion mw:LocalizedAttrs\" class=\"new\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Template:Main_Page\"},\"sa\":{\"href\":\":Template:Main Page\"},\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,30,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Main Page\",\"href\":\"./Template:Main_Page\"},\"params\":{\"1\":{\"wt\":\"Something else \"}},\"i\":0}}]}' data-mw-i18n='{\"title\":{\"lang\":\"x-page\",\"key\":\"red-link-title\",\"params\":[\"Template:Main Page\"]}}'>Template:Main Page</a></p>\n\n<p data-parsoid='{\"dsr\":[32,49,0,0]}'>{{ <span about=\"#mwt4\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[35,46,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"T290526\",\"href\":\"./Template:T290526\"},\"params\":{},\"i\":0}}]}'>Main Page|Something else</span> }}</p>" |
| 223 |
}, |
| 224 |
"Using {{!}} in wikilinks (T290526)": { |
| 225 |
"wt2html": "<p data-parsoid='{\"dsr\":[0,32,0,0]}'><a typeof=\"mw:ExpandedAttrs mw:LocalizedAttrs\" about=\"#mwt2\" rel=\"mw:WikiLink\" href=\"./Main_PageSomething_else?action=edit&redlink=1\" title=\"Main PageSomething else\" class=\"new\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_PageSomething_else\"},\"sa\":{\"href\":\"Main Page{{!}}Something else\"},\"dsr\":[0,32,null,null]}' data-mw='{\"attribs\":[[{\"txt\":\"href\"},{\"html\":\"Main Page<span about=\\\"#mwt1\\\" typeof=\\\"mw:Transclusion\\\" data-parsoid='{\\\"pi\\\":[[]],\\\"dsr\\\":[11,16,null,null]}' data-mw='{\\\"parts\\\":[{\\\"template\\\":{\\\"target\\\":{\\\"wt\\\":\\\"!\\\",\\\"function\\\":\\\"!\\\"},\\\"params\\\":{},\\\"i\\\":0}}]}'>|</span>Something else\"}]]}' data-mw-i18n='{\"title\":{\"lang\":\"x-page\",\"key\":\"red-link-title\",\"params\":[\"Main PageSomething else\"]}}'>Main PageSomething else</a></p>\n\n<p data-parsoid='{\"dsr\":[34,49,0,0]}'>[[<span about=\"#mwt7\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[]],\"dsr\":[36,47,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"T290526\",\"href\":\"./Template:T290526\"},\"params\":{},\"i\":0}}]}'>Main Page|Something else</span>]]</p>" |
| 226 |
}, |
| 227 |
"Verify that displaytitle works (T24501) AllowDisplayTitle=false": { |
| 228 |
"metadata": "Screen" |
| 229 |
}, |
| 230 |
"Verify that displaytitle works (T24501) AllowDisplayTitle=false no DISPLAYTITLE": { |
| 231 |
"metadata": "Screen" |
| 232 |
}, |
| 233 |
"Verify that displaytitle works (T24501) RestrictDisplayTitle=true mismatch": { |
| 234 |
"metadata": "Screen" |
| 235 |
}, |
| 236 |
"Verify that displaytitle works (T24501) no displaytitle": { |
| 237 |
"metadata": "Parser test" |
| 238 |
}, |
| 239 |
"Verify that without displaytitle the title encodes & to & (T291985)": { |
| 240 |
"metadata": "Art©" |
| 241 |
}, |
| 242 |
"div with illegal double attributes": { |
| 243 |
"wt2wt": "<div id=\"b\">HTML rocks</div>" |
| 244 |
}, |
| 245 |
"div with single-quoted attribute": { |
| 246 |
"wt2wt": "<div id=\"rock\">HTML rocks</div>" |
| 247 |
}, |
| 248 |
"div with unquoted attribute": { |
| 249 |
"wt2wt": "<div id=\"rock\">HTML rocks</div>" |
| 250 |
} |
| 251 |
} |