1 # MediaWiki Parser test cases
2 # Some taken from https://meta.wikimedia.org/wiki/Parser_testing
3 # All (C) their respective authors and released under the GPL
5 # The syntax should be fairly self-explanatory.
7 # Currently supported test options:
8 # One of the following three:
10 # (default) generate HTML output
11 # pst apply pre-save transform
12 # msg apply message transform
14 # Plus any combination of these:
16 # cat add category links
17 # (ignored by Parsoid, since it emits <link>s)
18 # ill add inter-language links
19 # (ignored by Parsoid, since it emits <link>s)
20 # subpage enable subpages (disabled by default)
21 # title=[[XXX]] run test using article title XXX
22 # language=XXX set content language to XXX for this test
23 # variant=XXX set the variant of language for this test (eg zh-tw)
24 # disabled do not run test
25 # parsoid parsoid-specific options (not run by PHP parser unless
26 # the test includes an html/php section)
27 # php php-only test (not run by the parsoid parser unless
28 # the test includes an html/parsoid section)
29 # showtitle make the first line the title
30 # showindicators make the first lines the page status indicators
31 # comment run through Linker::formatComment() instead of main parser
32 # local format section links in edit comment text as local links
33 # notoc disable table of contents
34 # thumbsize=NNN set the default thumb size to NNNpx for this test
35 # wrap include the normal wrapper <div class="mw-parser-output"> (since 1.30)
37 # You can also set the following parser properties via test options:
38 # wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
39 # wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic,
42 # For testing purposes, temporary articles can created:
43 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
44 # where '/' denotes a newline.
46 # This is the standard article assumed to exist.
66 Template:redirect to foo
68 #REDIRECT [[Template:Foo]]
89 MediaWiki:bad image list
91 * [[File:Bad.jpg]] except [[Nasty page]]
126 // For Serbian; localize Template namespace
134 Template:echo_with_span
140 Template:echo_with_div
146 Template:echo with depth
159 Template:table_attribs
162 |</noinclude>style="color:red;"|Foo
166 Template:table_attribs_2
169 |</noinclude>style="color:red;"|Foo
174 Template:table_attribs_3
177 |</noinclude>style{{=}}"background:#f9f9f9;"|Foo
181 Template:table_attribs_4
183 | style="background-color:#DC241f;" width="10px" |
187 Template:table_attribs_5
190 |</noinclude>style="color:red;"||Bar
194 Template:table_attribs_6
196 style="background: <nowiki>
203 Template:table_attribs_7
206 |</noinclude>style{{=}}"background:#f9f9f9;"|Foo<ref>foo</ref>
210 Template:table_header_cells
212 {{table_attribs}}!!style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz
218 {{table_attribs}}||style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz
222 Template:PartialTable
229 Template:image_attribs
232 [[File:foobar.jpg|</noinclude>right|Caption text<noinclude>]]</noinclude>
235 ## See T48811 for details
237 Template:mixed_attr_content_template
239 style="color:red;" title="T48811"
245 Template:definition_list
292 Template:EmptyTRWithHTMLAttrTest
295 <tr align="center"></tr>
296 <tr><td>foo</td></tr>
297 <tr align="center"></tr>
298 <tr><td>bar</td></tr>
321 This is a simple paragraph.
323 <p>This is a simple paragraph.
328 Paragraphs with extra newline spacing
351 Paragraphs with newline spacing with comment lines in between
359 <!--foo--><!--More than 1 comment, still stripped-->
363 <!--foo--> <!----> <!-- bar -->
424 Paragraphs with newline spacing with non-empty white-space lines in between
451 Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between
459 <!--foo--><!--More than 1 comment doesn't disable stripping of this line!-->
498 Extra newlines: More paragraphs with indented comment
513 Extra newlines followed by heading
528 <h1><span class="mw-headline" id="b">b</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
529 <p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
532 <h1><span class="mw-headline" id="b_2">b</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
537 Extra newlines between heading and content are swallowed
545 <h1><span class="mw-headline" id="b">b</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
546 <p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
551 Heading with line break in nowiki
555 wgFragmentMode=[ 'html5', 'legacy' ]
560 <h2><span id="A_B.0AC"></span><span class="mw-headline" id="A_B
562 C</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: A B C">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
566 C"><span id="A_B.0AC" typeof="mw:FallbackId"></span>A <span typeof="mw:Nowiki">B
573 http://fr.wikipedia.org/wiki/🍺
574 <!-- EasterEgg we love beer, better be able be able to link to it -->
576 <p><a rel="nofollow" class="external free" href="http://fr.wikipedia.org/wiki/🍺">http://fr.wikipedia.org/wiki/🍺</a>
595 *plain''italic''plain
596 *plain''italic''plain''italic''plain
597 *plain'''bold'''plain
598 *plain'''bold'''plain'''bold'''plain
599 *plain''italic''plain'''bold'''plain
600 *plain'''bold'''plain''italic''plain
601 *plain''italic'''bold-italic'''italic''plain
602 *plain'''bold''bold-italic''bold'''plain
603 *plain'''''bold-italic'''italic''plain
604 *plain'''''bold-italic''bold'''plain
605 *plain''italic'''bold-italic'''''plain
606 *plain'''bold''bold-italic'''''plain
607 *plain l'''italic''plain
608 *plain l''''bold''' plain
611 <li>plain<i>italic</i>plain</li>
612 <li>plain<i>italic</i>plain<i>italic</i>plain</li>
613 <li>plain<b>bold</b>plain</li>
614 <li>plain<b>bold</b>plain<b>bold</b>plain</li>
615 <li>plain<i>italic</i>plain<b>bold</b>plain</li>
616 <li>plain<b>bold</b>plain<i>italic</i>plain</li>
617 <li>plain<i>italic<b>bold-italic</b>italic</i>plain</li>
618 <li>plain<b>bold<i>bold-italic</i>bold</b>plain</li>
619 <li>plain<i><b>bold-italic</b>italic</i>plain</li>
620 <li>plain<b><i>bold-italic</i>bold</b>plain</li>
621 <li>plain<i>italic<b>bold-italic</b></i>plain</li>
622 <li>plain<b>bold<i>bold-italic</i></b>plain</li>
623 <li>plain l'<i>italic</i>plain</li>
624 <li>plain l'<b>bold</b> plain</li></ul>
628 # this example taken from the [[simple:Moon]] article (T49326)
630 Italics and possessives (1)
632 obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer
634 <p>obtained by <i><a href="/index.php?title=Lunar_Prospector&action=edit&redlink=1" class="new" title="Lunar Prospector (page does not exist)">Lunar Prospector</a>'</i>s gamma-ray spectrometer
638 # this example taken from [[en:Flaming Pie]] (T51926)
640 Italics and possessives (2)
642 '''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes
644 <p><i><b>Flaming Pie</b></i> is ... released in 1997. In <i>Flaming Pie'</i>s liner notes
648 # this example taken from [[en:Dictionary]] (T51926)
650 Italics and possessives (3)
652 The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[[Accademia della Crusca]]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''.
654 <p>The first monolingual dictionary written in a Romance language was <i>Sebastián Covarrubias'</i> <i>Tesoro de la lengua castellana o española</i>, published in 1611 in Madrid. In 1612 the first edition of the <i>Vocabolario dell'<a href="/index.php?title=Accademia_della_Crusca&action=edit&redlink=1" class="new" title="Accademia della Crusca (page does not exist)">Accademia della Crusca</a></i>, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the <i>Dictionnaire Universel</i>.
660 ### 2-quote opening sequence tests
663 Italics and bold: 2-quote opening sequence: (2,2)
672 Italics and bold: 2-quote opening sequence: (2,3)
681 Italics and bold: 2-quote opening sequence: (2,4)
691 # same html as previous, but wikitext adjusted to match parsoid html2wt
693 Italics and bold: 2-quote opening sequence: (2,4) w/ nowiki
695 ''foo<nowiki>''</nowiki>''
701 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
703 Italics and bold: 2-quote opening sequence: (2,5)
716 # same html as previous, but wikitext adjusted to match parsoid html2wt
718 Italics and bold: 2-quote opening sequence: (2,5+3) w/ nowiki
720 ''foo'''''<nowiki/>'''
731 ### 3-quote opening sequence tests
735 Italics and bold: 3-quote opening sequence: (3,2)
744 Italics and bold: 3-quote opening sequence: (3,3)
753 Italics and bold: 3-quote opening sequence: (3,4)
761 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
763 Italics and bold: 3-quote opening sequence: (3,5)
776 # same html as previous, but wikitext adjusted to match parsoid html2wt
778 Italics and bold: 3-quote opening sequence: (3,5+2) w/ nowiki
780 '''foo'''''<nowiki/>''
791 ### 4-quote opening sequence tests
795 Italics and bold: 4-quote opening sequence: (4,2)
805 # same html as previous, but wikitext adjusted to match parsoid html2wt
807 Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki
809 <nowiki>''</nowiki>''foo''
816 Italics and bold: 4-quote opening sequence: (4,3)
825 Italics and bold: 4-quote opening sequence: (4,4)
835 # same html as previous, but wikitext adjusted to match parsoid html2wt
837 Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki
845 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
847 Italics and bold: 4-quote opening sequence: (4,5)
856 <p>'<b>foo</b><i></i>
860 # same html as previous, but wikitext adjusted to match parsoid html2wt
862 Italics and bold: 4-quote opening sequence: (4,5+2) w/ nowiki
864 '<nowiki/>'''foo'''''<nowiki/>''
869 <p>'<b>foo</b><i></i>
875 ### 5-quote opening sequence tests
879 Italics and bold: 5-quote opening sequence: (5,2)
889 # same html as previous, but wikitext adjusted to match parsoid html2wt
891 Italics and bold: 5-quote opening sequence: (5,2+3)
900 Italics and bold: 5-quote opening sequence: (5,3)
910 # same html as previous, but wikitext adjusted to match parsoid html2wt
912 Italics and bold: 5-quote opening sequence: (5,3+2)
921 Italics and bold: 5-quote opening sequence: (5,4)
927 <p><i><b>foo'</b></i>
932 Italics and bold: 5-quote opening sequence: (5,5)
941 Italics and bold: 5-quote opening sequence: (5,6)
945 <p><i><b>foo'</b></i>
950 ### multiple quote sequences in a line
954 Italics and bold: multiple quote sequences: (2,4,2)
960 <p><i>foo'<b>bar</b></i>
964 # same html as previous, but wikitext adjusted to match parsoid html2wt
966 Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki
968 ''foo'<nowiki/>'''bar'''''
970 <p><i>foo'<b>bar</b></i>
975 Italics and bold: multiple quote sequences: (2,4,3)
981 <p><i>foo'<b>bar</b></i>
985 # same html as previous, but wikitext adjusted to match parsoid html2wt
987 Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki
989 ''foo'<nowiki/>'''bar'''''
991 <p><i>foo'<b>bar</b></i>
996 Italics and bold: multiple quote sequences: (2,4,4)
1002 <p><i>foo'<b>bar'</b></i>
1006 # same html as previous, but wikitext adjusted to match parsoid html2wt
1008 Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki
1010 ''foo'<nowiki/>'''bar'<nowiki/>'''''
1012 <p><i>foo'<b>bar'</b></i>
1016 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
1018 Italics and bold: multiple quote sequences: (3,4,2)
1027 <p><b>foo'</b>bar<i></i>
1031 # same html as previous, but wikitext adjusted to match parsoid html2wt
1033 Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki
1035 '''foo''''bar''<nowiki/>''
1040 <p><b>foo'</b>bar<i></i>
1044 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
1046 Italics and bold: multiple quote sequences: (3,4,3)
1055 <p><b>foo'</b>bar<b></b>
1059 # same html as previous, but wikitext adjusted to match parsoid html2wt
1061 Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki
1063 '''foo''''bar'''<nowiki/>'''
1068 <p><b>foo'</b>bar<b></b>
1073 ### other quote tests
1076 Italics and bold: other quote tests: (2,3,5)
1078 ''this is about '''foo's family'''''
1080 <p><i>this is about <b>foo's family</b></i>
1086 Italics and bold: other quote tests: (2,(3,3),2)
1088 ''this is about '''foo's''' family''
1090 <p><i>this is about <b>foo's</b> family</i>
1096 Italics and bold: other quote tests: (3,2,3,2)
1100 '''this is about ''foo'''s family''
1102 <p><b>this is about <i>foo</i></b><i>s family</i>
1107 # same html as previous, but wikitext adjusted to match parsoid html2wt
1109 Italics and bold: other quote tests: (3,2,3+2+2,2)
1111 '''this is about ''foo'''''<nowiki/>''s family''
1113 <p><b>this is about <i>foo</i></b><i>s family</i>
1119 Italics and bold: other quote tests: (3,2,3,3)
1121 '''this is about ''foo'''s family'''
1123 <p>'<i>this is about </i>foo<b>s family</b>
1129 Italics and bold: other quote tests: (3,(2,2),3)
1131 '''this is about ''foo's'' family'''
1133 <p><b>this is about <i>foo's</i> family</b>
1139 Italicized possessive
1141 The ''[[Main Page]]'''s talk page.
1143 <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
1146 <p>The <i><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
1150 Quote balancing context should be restricted to td/th cells on the same wikitext line
1152 parsoid=wt2html,wt2wt
1166 </td></tr></tbody></table>
1174 Non-html5 tags should be accepted
1176 <center>''foo''</center>
1178 <font>''foo''</font>
1179 <strike>''foo''</strike>
1182 <center><i>foo</i></center>
1183 <p><big><i>foo</i></big>
1184 <font><i>foo</i></font>
1185 <strike><i>foo</i></strike>
1191 <wbr> is valid wikitext (T54468)
1199 # <strike> is HTML4, <s> is HTML4/5.
1201 <s> or <strike> for strikethrough
1203 <strike>strike</strike>
1207 <p><strike>strike</strike>
1215 Text-level semantic html elements in wikitext
1218 <strong>text</strong>
1234 <ruby><rb>明日</rb><rp>(</rp><rt>Ashita</rt><rp> </rp><rtc>あした</rtc><rp>)</rp></ruby>
1241 <strong>text</strong>
1257 <ruby><rb>明日</rb><rp>(</rp><rt>Ashita</rt><rp> </rp><rtc>あした</rtc><rp>)</rp></ruby>
1265 # test cases taken from
1266 # https://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element
1268 Ruby markup (W3C-style)
1270 ;Mono-ruby for individual base characters
1271 :<ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby>
1273 :<ruby>今日<rt>きょう</rt></ruby>
1275 :<ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby>
1277 :<ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby>
1279 :<ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby>
1282 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
1283 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
1284 <rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang="fr"><rt>Étoile</rt></rtc>
1287 <dl><dt>Mono-ruby for individual base characters</dt>
1288 <dd><ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby></dd>
1290 <dd><ruby>今日<rt>きょう</rt></ruby></dd>
1291 <dt>Jukugo ruby</dt>
1292 <dd><ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby></dd>
1293 <dt>Inline ruby</dt>
1294 <dd><ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby></dd>
1295 <dt>Double-sided ruby</dt>
1296 <dd><ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby></dd></dl>
1298 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
1299 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
1300 <rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang="fr"><rt>Étoile</rt></rtc>
1305 # The next two test different paths in the sanitizer.
1307 Non-word characters don't terminate tag names (T19663, T42670, T54022)
1309 <blockquote|>a</blockquote>
1311 <b→> doesn't terminate </b→>
1313 <bä> doesn't terminate </bä>
1315 <boo> doesn't terminate </boo>
1317 <s.foo> doesn't terminate </s.foo>
1321 <p><blockquote|>a</blockquote>
1322 </p><p><b→> doesn't terminate </b→>
1323 </p><p><bä> doesn't terminate </bä>
1324 </p><p><boo> doesn't terminate </boo>
1325 </p><p><s.foo> doesn't terminate </s.foo>
1326 </p><p><sub-ID#1>
1331 Non-word characters don't terminate tag names
1333 <blockquote|>a</blockquote>
1335 <b→> doesn't terminate </b→>
1337 <bä> doesn't terminate </bä>
1339 <boo> doesn't terminate </boo>
1341 <s.foo> doesn't terminate </s.foo>
1345 <p><blockquote|>a
1346 </p><p><b→> doesn't terminate </b→>
1347 </p><p><bä> doesn't terminate </bä>
1348 </p><p><boo> doesn't terminate </boo>
1349 </p><p><s.foo> doesn't terminate </s.foo>
1350 </p><p><sub-ID#1>
1355 ### See tests/parser/parserTestsParserHook.php for the <tåg> extension)
1356 ### This checks that HTML5 tags (with non-word characters in the tag
1357 ### name) make it safely through the parser -- the Sanitizer will
1358 ### munge them later, as it should.
1361 Non-word characters are valid in extension tags (T19663)
1372 <pre typeof="mw:Extension/tåg" data-mw='{"name":"tåg","attrs":{},"body":{"extsrc":"tåg"}}' data-parsoid='{}' about="#mwt2"></pre>
1376 Isolated close tags should be treated as literal text (T54760)
1384 <p class="mw-empty-elt">
1385 </p><p><s.foo>s
1388 <p><s.foo>s</p>
1392 ### Special characters
1396 Bare pipe character (T54363)
1405 Bare pipe character from a template (T54363)
1414 ### <nowiki> test cases
1418 <nowiki> unordered list
1420 <nowiki>* This is not an unordered list item.</nowiki>
1422 <p>* This is not an unordered list item.
1425 <p><span typeof="mw:Nowiki">* This is not an unordered list item.</span></p>
1431 <nowiki>Lorem ipsum dolor
1439 <p>Lorem ipsum dolor
1448 <p><span typeof="mw:Nowiki">Lorem ipsum dolor
1458 Don't parse <nowiki><span class="error"></nowiki> (T149622)
1460 <nowiki><span class="error"></nowiki>
1462 <p><span class="error">
1465 <p><span typeof="mw:Nowiki"><span class="error"></span></p>
1471 :There is not nowiki.
1472 :There is <nowiki>nowiki</nowiki>.
1474 #There is not nowiki.
1475 #There is <nowiki>nowiki</nowiki>.
1477 *There is not nowiki.
1478 *There is <nowiki>nowiki</nowiki>.
1480 <dl><dd>There is not nowiki.</dd>
1481 <dd>There is nowiki.</dd></dl>
1482 <ol><li>There is not nowiki.</li>
1483 <li>There is nowiki.</li></ol>
1484 <ul><li>There is not nowiki.</li>
1485 <li>There is nowiki.</li></ul>
1488 <dl><dd data-parsoid='{}'>There is not nowiki.</dd>
1489 <dd data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</dd></dl>
1491 <ol><li data-parsoid='{}'>There is not nowiki.</li>
1492 <li data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</li></ol>
1494 <ul><li data-parsoid='{}'>There is not nowiki.</li>
1495 <li data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</li></ul>
1499 Entities inside <nowiki>
1501 <nowiki><</nowiki>
1506 <p><span typeof="mw:Nowiki"><span typeof="mw:Entity" data-parsoid='{"src":"&lt;","srcContent":"<"}'><</span></span></p>
1510 Entities inside template parameters
1517 <p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&ndash;"}},"i":0}}]}'>–</span></p>
1521 Properly escape nowiki when combined with other wiki markup
1525 <p>* </nowiki> tag</p>
1527 <nowiki>*</nowiki> <nowiki></nowiki></nowiki> tag
1531 T93824: Put escaped HTML tags inside nowiki
1535 <p><h2>foo</h2></p>
1537 <nowiki><h2>foo</h2></nowiki>
1541 T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars
1545 <p>This text: L'<a rel="mw:WikiLink" href="./Foo">Foo</a>
1546 This text: L''<a rel="mw:WikiLink" href="./Foo">Foo</a>
1547 This text: L'''<a rel="mw:WikiLink" href="./Foo">Foo</a>''</p>
1549 This text: L'[[Foo]]
1550 This text: L<nowiki>''</nowiki>[[Foo]]
1551 This text: L<nowiki>'''</nowiki>[[Foo]]<nowiki>''</nowiki>
1554 # This test fails because wikitext whitespace is not normalized before comparing.
1556 T71950: 2. Put nowiki as close to cause as possible, after ' :'
1560 <p>This text : L''<a rel="mw:WikiLink" href="./Foo">Foo</a>
1563 This text : L<nowiki>''</nowiki>[[Foo]]
1566 # This test and the next one are html2wt only as they test that incorrect wikitext
1567 # passed in template arguments gets escaped or wrapped in nowikis where required.
1569 T71482: Use {{!}} instead of nowiki for single pipe in template argument
1573 <p><span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo|bar"}},"i":0}}]}" about="#mwt1"></span>
1574 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo|bar |[["}},"i":0}}]}" about="#mwt2"></p>
1576 {{echo|foo{{!}}bar}}
1577 {{echo|<nowiki>foo|bar |[[</nowiki>}}
1581 T53961: Output correct nowikis in template arguments
1585 <p><span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a [ b"}},"i":0}}]}" about="#mwt1"></span>
1586 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }} b"}},"i":0}}]}" about="#mwt2"></span>
1587 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a [[ b"}},"i":0}}]}" about="#mwt3"></span>
1588 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a | {{ ]]"}},"i":0}}]}" about="#mwt4"></span>
1589 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }"}},"i":0}}]}" about="#mwt5"></span></p>
1592 {{echo|<nowiki>a }} b</nowiki>}}
1593 {{echo|<nowiki>a [[ b</nowiki>}}
1594 {{echo|<nowiki>a | {{ ]]</nowiki>}}
1595 {{echo|a <nowiki>}</nowiki>}}
1599 Cases where "!!" needs nowiki protection
1604 <tr><th>this needs protection !! here</th></tr>
1608 <tr><th>this does not need
1609 protection !! here</th></tr>
1613 !<nowiki>this needs protection !! here</nowiki>
1626 Comments and Indent-Pre
1628 <!-- comment 1 --> asdf
1630 <!-- comment 1 --> asdf
1633 <!-- comment 1 --> asdf
1634 <!-- comment 2 -->xyz
1636 <!-- comment 1 --> asdf
1637 <!-- comment 2 --> xyz
1693 asdf<!-- comment 1 -->jkl
1703 <!-- foo --> b <!-- bar -->
1717 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
1723 Comment semantics and delimiters
1725 <!-- --><!----><!-----><!------>
1729 <!-- --><!----><!-----><!------>
1733 Comment semantics and delimiters, redux
1735 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
1736 -- foo -- funky huh? ... -->
1740 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
1741 -- foo -- funky huh? ... -->
1745 Comment semantics and delimiters: directors cut
1747 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
1748 everything starting with < followed by !-- until the first -- and > we see,
1749 that wouldn't be valid XML however, since in XML -- has to terminate a comment
1755 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
1756 everything starting with < followed by !-- until the first -- and > we see,
1757 that wouldn't be valid XML however, since in XML -- has to terminate a comment
1762 Comment semantics: nesting
1764 <!--<!-- no, we're not going to do anything fancy here -->-->
1769 <!--<!-- no, we're not going to do anything fancy here --><p>--></p>
1772 # Parsoid closes the unclosed comment, even if it means a slight
1775 Comment semantics: unclosed comment at end
1777 parsoid=wt2html,html2html
1779 <!--This comment will run out to the end of the document
1783 <!--This comment will run out to the end of the document-->
1787 Comment semantics: normalize comments to play nice with XML and browsers
1789 <!-- Browsers --!> think this is closed -->
1790 <!--> This would normally be text -->
1791 <!---> As would this -->
1792 <!-- XML doesn't like trailing dashes -------->
1793 <!-- Nor doubled hyphens -- anywhere in the data -->
1794 But this is not a comment.
1796 <p>But this is not a comment.
1799 <!-- Browsers --!> think this is closed -->
1800 <!--> This would normally be text -->
1801 <!---> As would this -->
1802 <!-- XML doesn't like trailing dashes -------->
1803 <!-- Nor doubled hyphens -- anywhere in the data -->
1804 <p>But this is not a comment.</p>
1808 Comment semantics: round-trip even text which contains encoded -->
1810 <!-- hello & goodbye - > --> --&gt; --&xx -->
1812 <!-- hello & goodbye - > --> --&gt; --&xx -->
1816 Comment in template title
1825 Comment on its own line post-expand
1837 Comment on its own line post-expand with non-significant whitespace
1849 post-expand include size being exceeded
1853 {{echo3|1234567890}}
1855 <p><a href="/wiki/Template:Echo3" title="Template:Echo3">Template:Echo3</a><!-- WARNING: template omitted, post-expand include size too large -->
1860 max template depth being reached
1864 {{echo with depth|too deep!}}
1866 <p><span class="error">Template recursion depth limit exceeded (1)</span>
1871 multiple templates that are redirects
1882 Multiple comments should still parse as SOL-transparent
1884 parsoid=wt2html,wt2wt
1887 <!--c2--><!--c3--><!--c4-->*b
1896 <!--c2--><!--c3--><!--c4-->
1902 ## Make sure ">" gets escaped in comments to avoid XSS
1904 IE conditional comments
1907 <script>alert('hi');</script>
1910 <!--[if lt IE 9]>
1911 <script>alert('hi');</script>
1916 ### paragraph wrapping tests
1932 Block tag on one line (<div>)
1942 <p>a </p><div>foo</div>
1947 # Remex wraps empty tag runs with p-tags.
1948 # Parsoid strips them out during p-wrapping.
1950 No p-wrappable content
1952 <span><div>x</div></span>
1953 <span><s><div>x</div></s></span>
1954 <small><em></em></small><span><s><div>x</div></s></span>
1956 <span><div>x</div></span>
1957 <span><s><div>x</div></s></span>
1958 <p><small><em></em></small></p><span><s><div>x</div></s></span>
1960 <span><div>x</div></span>
1961 <span><s><div>x</div></s></span>
1962 <small><em></em></small><span><s><div>x</div></s></span>
1965 # T177612: Parsoid-only test
1967 Transclusion meta tags shouldn't trip Parsoid's useless p-wrapper stripping code
1969 {{echo|<span><div>x</div></span>}}
1972 <span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<span><div>x</div></span>"}},"i":0}}]}'><div>x</div></span>
1977 Block tag on one line (<blockquote>)
1979 a <blockquote>foo</blockquote>
1983 a <blockquote>foo</blockquote>
1987 <p>a </p><blockquote><p>foo</p></blockquote>
1993 Block tag on both lines (<div>)
2003 <p>a </p><div>foo</div><p>
2004 b </p><div>foo</div>
2008 Block tag on both lines (<blockquote>)
2010 a <blockquote>foo</blockquote>
2012 b <blockquote>foo</blockquote>
2014 a <blockquote>foo</blockquote>
2015 b <blockquote>foo</blockquote>
2018 <p>a </p><blockquote><p>foo</p></blockquote><p>
2019 b </p><blockquote><p>foo</p></blockquote>
2023 Multiple lines without block tags
2044 x </p><div>foo</div><p> z
2048 # The difference between Parsoid & Remex here
2049 # is because of Parsoid's Tidy-emulation code
2050 # for p-wrapping. We'll start work to remove this
2051 # emulation code in Parsoid sooner than later.
2052 # Remex wraps empty tag runs with p-tags.
2053 # Parsoid strips them out in a separate pass.
2055 Empty lines between lines with block tags
2090 </p><div>b</div><p>d
2095 <div data-parsoid='{"stx":"html"}'></div>
2098 <div data-parsoid='{"stx":"html"}'></div><p>a</p>
2101 <div data-parsoid='{"stx":"html"}'>a</div><p>b</p>
2103 <div data-parsoid='{"stx":"html"}'>b</div><p>d</p>
2106 <div data-parsoid='{"stx":"html"}'>e</div>
2110 Unclosed HTML p-tags should be handled properly
2117 <div><p>foo</p></div>
2122 <div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div>
2127 ## SSS FIXME: I can come up with other scenarios where this doesn't work because
2128 ## of eager output of buffered tokens in the p-wrapper. But, I'm going to ignore
2131 1. P-wrapping should leave sol-transparent tags outside p-tags where possible
2135 a [[Category:A1]] [[Category:A2]]
2140 <link rel="mw:PageProp/Category" href="./Category:A1"/> <link rel="mw:PageProp/Category" href="./Category:A2"/> <link rel="mw:PageProp/Category" href="./Category:A3"/> <link rel="mw:PageProp/Category" href="./Category:A4"/>
2144 2. P-wrapping should leave sol-transparent tags outside p-tags where possible
2150 <link rel="mw:PageProp/Category" href="./Category:A1"/><p>a</p>
2154 No paragraph necessary for SOL transparent template
2156 <span><div>foo</div></span>
2159 <span><div>foo</div></span>
2160 {{echo|[[Category:Foo]]}}
2162 <span><div>foo</div></span>
2163 <span><div>foo</div></span>
2166 <span data-parsoid='{"stx":"html"}'><div data-parsoid='{"stx":"html"}'>foo</div></span>
2167 <link rel="mw:PageProp/Category" href="./Category:Foo"/>
2169 <span data-parsoid='{"stx":"html"}'><div data-parsoid='{"stx":"html"}'>foo</div></span>
2170 <link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Foo]]"}},"i":0}}]}'/>
2174 Avoid expanding multiline sol transparent template ranges unnecessarily
2192 <br about="#mwt1" typeof="mw:Transclusion" data-parsoid='{}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<br/>\n"}},"i":0}}]}'/><span about="#mwt1">
2195 <link rel="mw:PageProp/Category" href="./Category:Ho" />
2199 ### Preformatted text
2209 And a [[Main Page|link]]
2215 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
2220 Tabs don't trigger preformatted text
2224 This is preformatted text.
2230 <pre>This is preformatted text.
2235 preformatted text.</p>
2236 <pre>This is preformatted text.
2241 Space before tab needs nowiki pre protection
2247 <nowiki> </nowiki> a
2251 Ident preformatting with inline content
2262 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
2279 Regression with preformatted in <center>
2293 T54763: Preformatted in <blockquote>
2299 indented cell (no pre-wrapping!)
2309 <p> indented cell (no pre-wrapping!)
2317 T53086: Double newlines in blockquotes should be turned into paragraphs
2334 T17491: <ins>/<del> in blockquote
2337 Foo <del>bar</del> <ins>baz</ins> quux
2341 <p>Foo <del>bar</del> <ins>baz</ins> quux
2348 T17491: <ins>/<del> in blockquote (2)
2350 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
2353 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
2357 <blockquote><p>Foo </p><del>bar</del> <ins>baz</ins><p> quux
2362 <pre> with attributes (T5202)
2364 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
2366 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
2371 <pre> with width attribute (T5202)
2373 <pre width="8">Narrow screen goodies</pre>
2375 <pre width="8">Narrow screen goodies</pre>
2380 <pre> with forbidden attribute (T5202)
2382 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
2384 <pre width="8">Narrow screen goodies</pre>
2389 Entities inside <pre>
2398 <pre> with forbidden attribute values (T5202)
2400 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
2402 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
2407 <nowiki> inside <pre> (T15238)
2415 <pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>
2423 <pre><nowiki>Foo</nowiki></pre>
2428 <nowiki> inside of #tag:pre
2430 {{#tag:pre|Foo <nowiki>→bar</nowiki>}}
2432 <pre>Foo →bar</pre>
2435 <pre about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:pre","function":"tag"},"params":{"1":{"wt":"Foo <nowiki>&rarr;bar</nowiki>"}},"i":0}}]}'>Foo <span typeof="mw:Entity">→</span>bar</pre>
2438 ## Don't expect this to rt, Parsoid drops the unmatched closing pre tags that
2439 ## aren't enclosed in nowikis.
2441 <nowiki> and <pre> preference (first one wins)
2472 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n<nowiki>\n"}}'><nowiki>
2477 <p><span typeof="mw:Nowiki">
2485 </pre> inside nowiki
2487 <nowiki></pre></nowiki>
2494 Empty pre; pre inside other HTML tags (T56946)
2511 <div data-parsoid='{"stx":"html"}'><pre typeof="mw:Extension/pre" about="#mwt2" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\nfoo\n"}}'>foo
2513 <pre typeof="mw:Extension/pre" about="#mwt4" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":""}}'></pre>
2517 HTML pre followed by indent-pre
2530 <p><pre>foo</pre></p>
2532 <p class="mw-empty-elt"></p><pre>foo</pre><p class="mw-empty-elt"></p>
2534 <p class='mw-empty-elt' data-parsoid='{"stx":"html","autoInsertedEnd":true}'></p><pre typeof="mw:Extension/pre" about="#mwt2" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre><p class='mw-empty-elt' data-parsoid='{"autoInsertedStart":true,"stx":"html"}'></p>
2538 Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>
2546 Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>
2556 Templates: Indent-Pre: 1c: Wrapping should be based on expanded content
2568 Templates: Indent-Pre: 1d: Wrapping should be based on expanded content
2589 Templates: Indent-Pre: 1e. Wrapping should be based on expanded content
2593 {{echo| foo}}{{echo| bar}}
2598 {{echo|<!--cmt--> foo}}
2600 <!--cmt-->{{echo| foo}}
2602 {{echo|{{echo| }}bar}}
2620 Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
2656 ## Hmm, should Parsoid rt this?
2658 Pres with newline attributes
2660 parsoid=wt2html,html2html
2665 <pre class="one two">hi</pre>
2668 <pre typeof="mw:Extension/pre" about="#mwt2" class="one two" data-mw='{"name":"pre","attrs":{"class":"one two"},"body":{"extsrc":"hi"}}'>hi</pre>
2672 Things that look like <pre> tags aren't treated as such
2674 Barack Obama <President> of the United States
2675 <President></President>
2677 <p>Barack Obama <President> of the United States
2678 <President></President>
2683 Handle broken pre-like tags (T66025)
2687 {{echo|<pre <pre>x</pre>}}
2689 <table><pre </table>
2692 <table><pre </table>
2696 <pre <table></table>
2698 <pre about="#mwt1" typeof="mw:Transclusion mw:Extension/pre" data-parsoid='{"a":{"<pre":null},"sa":{"<pre":""},"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<pre <pre>x</pre>"}},"i":0}}]}'>x</pre>
2707 Parsoid: handle pre with space after attribute
2711 <pre style="width:50%;" >{{echo|foo}}</pre>
2713 <pre style="width:50%;">{{echo|foo}}</pre>
2716 <pre typeof="mw:Extension/pre" about="#mwt2" style="width:50%;" data-mw='{"name":"pre","attrs":{"style":"width:50%;"},"body":{"extsrc":"{{echo|foo}}"}}'>{{echo|foo}}</pre>
2719 # TODO / maybe: fix wt2wt for this
2721 Parsoid: Don't paragraph-wrap fosterable content
2754 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":null}'></pre>
2758 Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
2786 #--------------------------------------------------------------------
2787 # Transclusion parameter whitespace stripping tests
2788 # Behavior is different for positional and named parameters
2789 #--------------------------------------------------------------------
2791 Templates: Strip leading and trailing whitespace from named-param values
2795 {{echo|1= {{echo|b}} }}
2813 Templates: Don't strip whitespace from positional-param values
2817 {{echo|{{echo|b}} }}
2857 Templates: Don't recognize targets split by newlines
2873 Templates: Recognize targets when newlines and comments don't split the target
2878 <!--X--> ech<!--X-->o<!--X-->
2886 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ech<!--X-->o<!--X--> \n <!--X--> <!--X-->\n\n ","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2890 Templates: Handle empty comment-and-ws-only lines correctly
2893 <!--should be ignored-->
2894 <!--should be ignored as well-->
2901 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo\n<!--should be ignored-->\n <!--should be ignored as well-->\nbar"}},"i":0}}]}'>foo <!--should be ignored--> <!--should be ignored as well--> bar</p>
2905 Templates: Handle comments in the target
2908 <!-- should be ignored -->
2912 <!-- should be ignored and spaces on next line should not trip us up (T147742) -->
2915 {{echo<!-- should be ignored -->
2918 {{echo<!-- should be ignored -->|foo}}
2920 {{<!-- should be ignored -->echo|foo}}
2929 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo\n<!-- should be ignored -->\n","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2931 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n ","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2933 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo<!-- should be ignored -->\n","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2935 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo<!-- should be ignored -->","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2937 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2941 Templates: Handle comments in parameter names (T69657)
2944 <!-- should be ignored -->
2948 <!-- should be ignored -->
2951 {{echo|1<!-- should be ignored -->=foo}}
2953 {{echo|<!-- should be ignored -->1=foo}}
2961 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"1\n<!-- should be ignored -->"}}},"i":0}}]}'>foo</p>
2963 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"<!-- should be ignored -->\n1"}}},"i":0}}]}'>foo</p>
2965 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"1<!-- should be ignored -->"}}},"i":0}}]}'>foo</p>
2967 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"<!-- should be ignored -->1"}}},"i":0}}]}'>foo</p>
2971 Templates: Other wikitext in parameter names (T69657)
2978 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"''1''":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p>
2982 Templates: With colons
2986 <p>Template with colon
2989 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"With: Colon","href":"./Template:With:_Colon"},"params":{},"i":0}}]}'>Template with colon</p>
2992 #--------------------------------------------------------------------
2993 # Transclusion parameter escaping tests
2994 #--------------------------------------------------------------------
2997 Templates: Parsoid parameter escaping test 1
2999 {{echo|[foo]|{{echo|[bar]}}}}
3004 <p about="#mwt1" typeof="mw:Transclusion"
3005 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}}]}'>[foo]</p>
3009 Parsoid: Pipes in external links in template parameter
3011 {{echo|[{{echo|http://example.com}} link]}}
3013 <p><a rel="nofollow" class="external text" href="http://example.com">link</a>
3016 <p><a rel="mw:ExtLink" class="external text" href="http://example.com" about="#mwt31" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{echo|http://example.com}} link]"}},"i":0}}]}'>link</a></p>
3020 Parsoid: pipe in transclusion parameter
3022 {{echo|http://foo.com/a|b}}
3024 <p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a>
3027 <p><a rel="mw:ExtLink" class="external free" href="http://foo.com/a%7Cb" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&#124;b"}},"i":0}}]}'>http://foo.com/a%7Cb</a></p>
3031 Parsoid: Pipe in external link target and content in template parameter
3033 parsoid=html2wt,wt2wt
3035 {{echo|[http://foo.com/a|b a|b]}}
3037 <p><a rel="nofollow" class="external text" href="http://foo.com/a%7Cb">a|b</a>
3040 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
3041 typeof="mw:Transclusion"
3042 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
3043 "params":{"1":{"wt":"[http://foo.com/a|b a|b]"}},"i":0}}]}'>a|b</a></p>
3047 Parsoid: Pipe in template with nested template in external link target in template parameter (seriously)
3051 {{echo|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}
3053 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]"}},"i":0}}]}'>[Main Page bar]</p>
3057 Templates: Don't escape already nowiki-escaped text in template parameters
3059 parsoid=html2wt,wt2wt
3061 {{echo|foo<nowiki>|</nowiki>bar}}
3062 {{echo|<nowiki><div></nowiki>}}
3063 {{echo|<nowiki></nowiki>}}
3070 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<nowiki>|</nowiki>bar"}},"i":0}}]}'}'>foo</span><span typeof="mw:Nowiki" about="#mwt1">|</span><span about="#mwt1">bar</span>
3071 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt2" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>&lt;div&gt;</nowiki>"}},"i":0}}]}'><span typeof="mw:Entity"><</span>div<span typeof="mw:Entity">></span></span>
3072 <span typeof="mw:Transclusion mw:Nowiki" about="#mwt3" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki></nowiki>"}},"i":0}}]}'></span>
3078 Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param
3080 parsoid=html2wt,wt2wt
3082 {{echo|{{echo|1=bar}}}}
3087 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{echo|1=bar}}"}},"i":0}}]}'>bar</p>
3092 Templates parameters with special tokenizing behavior dont get modified because of arg escaping
3099 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a : b"}},"i":0}}]}'>a<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"isDisplayHack":true}'> </span>: b</p>
3104 Templates: Preserve blank parameter names
3111 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p>
3115 Templates: Preserve blank parameter names in other positions
3117 {{blank_param|bar|=foo}}
3123 <p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"},{"k":"","named":true}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"blank_param","href":"./Template:Blank_param"},"params":{"1":{"wt":"bar"},"":{"wt":"foo"}},"i":0}}]}'>bar
3128 ### Parsoid-centric tests for testing RT edge cases for pre
3132 1a. Indent-Pre and Comments
3145 1b. Indent-Pre and Comments
3158 1c. Indent-Pre and Comments
3171 1d. Indent-Pre and Comments
3172 (Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order)
3185 2a. Indent-Pre and tables
3206 2b. Indent-Pre and tables
3222 2c. Indent-Pre and tables (T44252)
3239 2d. Indent-Pre and tables
3256 <tbody><tr><td> b</td></tr>
3261 2e. Indent-Pre and table-line syntax
3274 2f. Indent-pre started by table-line syntax
3293 2g. Indented table markup mixed with indented pre content (proposed in T8200)
3298 Text that should be rendered preformatted
3306 <pre>Text that should be rendered preformatted
3315 3a. Indent-Pre and block tags (single-line html)
3319 c <blockquote> foo </blockquote>
3324 c <blockquote> foo </blockquote>
3325 <pre><span> foo </span>
3328 <p>a </p><p data-parsoid='{"stx":"html"}'> foo </p>
3329 <p>b </p><div data-parsoid='{"stx":"html"}'> foo </div>
3330 <p>c </p><blockquote data-parsoid='{"stx":"html"}'> foo </blockquote>
3331 <pre><span> foo </span>
3334 <p> a </p><p> foo </p><p>
3335 b </p><div> foo </div><p>
3336 c </p><blockquote><p> foo </p></blockquote>
3337 <pre><span> foo </span>
3342 3b. Indent-Pre and block tags (multi-line html)
3347 <pre>a <span>foo</span>
3352 <pre>a <span data-parsoid='{"stx":"html"}'>foo</span></pre>
3353 b <div data-parsoid='{"stx":"html"}'> foo </div>
3355 <pre>a <span>foo</span>
3357 b </p><div> foo </div>
3361 3c. Indent-Pre and block tags (pre-content on separate line)
3425 4. Indent-Pre and extension tags
3436 a <pre typeof="mw:Extension/tag" about="#mwt2" data-parsoid='{}' data-mw='{"name":"tag","attrs":{},"body":null}'></pre>
3440 5. Indent-Pre and html pre
3442 <pre class="123">hi</pre>
3444 <pre class="123">hi</pre>
3447 <pre typeof="mw:Extension/pre" about="#mwt2" class="123" data-mw='{"name":"pre","attrs":{"class":"123"},"body":{"extsrc":"hi"}}'>hi</pre>
3451 Render paragraphs when indent-pre is suppressed in blocklevels
3468 4. Multiple spaces at start-of-line
3486 ## NOTE: the leading white-space chars on empty line are significant
3488 5a. White-space in indent-pre
3500 ## NOTE: the leading white-space chars on empty line are significant
3502 5b. White-space in indent-pre
3521 5c. White-space in indent-pre
3534 6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content
3557 7a. Indent-pre and category links
3559 parsoid=wt2html,wt2wt
3561 [[Category:foo]] <!-- No pre-wrapping -->
3562 {{echo| [[Category:foo]]}} <!-- No pre-wrapping -->
3565 <link rel="mw:PageProp/Category" href="./Category:Foo"> <!-- No pre-wrapping -->
3566 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping -->
3569 ## We used to, but no longer wt2wt this test since the default serializer
3570 ## will normalize all categories to serialize on their own line.
3571 ## This wikitext usage is going to be fairly uncommon in production and
3572 ## selser will take care of preserving formatting in those scenarios.
3574 7b. Indent-pre and category links
3579 [[Category:foo]] {{echo|b}}
3581 <pre><link rel="mw:PageProp/Category" href="./Category:Foo"> a
3582 <link rel="mw:PageProp/Category" href="./Category:Foo"> <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b"}},"i":0}}]}'>b</span></pre>
3586 Indent-Pre: Newlines in comments shouldn't affect sol state
3601 ### HTML-pre (some to spec PHP parser behavior and some Parsoid-RT-centric)
3605 HTML-pre: 1. embedded newlines
3637 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre>
3639 <pre typeof="mw:Extension/pre" about="#mwt4" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\nfoo\n"}}'>foo
3642 <pre typeof="mw:Extension/pre" about="#mwt6" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n\nfoo\n"}}'>
3647 <pre typeof="mw:Extension/pre" about="#mwt8" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n\n\nfoo\n"}}'>
3655 HTML-pre: big spaces
3691 <pre typeof="mw:Extension/pre" about="#mwt2" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n\n\n\n\nhaha\n\n\n\n\nhaha\n\n\n\n\n"}}'>
3710 HTML-pre: 2: indented text
3723 HTML-pre: 3: other wikitext
3742 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n* foo\n# bar\n= no-h =\n'' no-italic ''\n[[ NoLink ]]\n"}}'>* foo
3751 ### Definition lists
3758 <dl><dt>name </dt>
3759 <dd>Definition</dd></dl>
3764 Definition list for indentation only
3768 <dl><dd>Indented text</dd></dl>
3773 Definition list with no space
3778 <dd>Definition</dd></dl>
3783 Definition list with URL link
3785 ;http://example.com/ :definition
3787 <dl><dt><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> </dt>
3788 <dd>definition</dd></dl>
3793 Definition list with bracketed URL link
3795 ;[http://www.example.com/ Example]:Something about it
3797 <dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt>
3798 <dd>Something about it</dd></dl>
3803 Definition list with wikilink containing colon
3805 ; [[Help:FAQ]]:The least-read page on Wikipedia
3807 <dl><dt><a href="/index.php?title=Help:FAQ&action=edit&redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt>
3808 <dd>The least-read page on Wikipedia</dd></dl>
3812 # At Brion's and JeLuF's insistence... :)
3814 Definition list with news link containing colon
3816 ;news:alt.wikipedia.rox: This isn't even a real newsgroup!
3818 <dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
3819 <dd>This isn't even a real newsgroup!</dd></dl>
3822 <dl><dt> <a rel="mw:ExtLink" class="external free" href="news:alt.wikipedia.rox" data-parsoid='{"stx":"url"}'>news:alt.wikipedia.rox</a></dt><dd data-parsoid='{"stx":"row"}'>This isn't even a real newsgroup!</dd></dl>
3826 Malformed definition list with colon
3828 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
3830 <dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop</dt></dl>
3835 Definition lists: colon in external link text
3837 ;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up
3839 <dl><dt><a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia :The Next Generation</a> </dt>
3840 <dd>OK, I made that up</dd></dl>
3845 Definition lists: colon in HTML attribute
3847 ;<b style="display: inline">bold</b>
3849 <dl><dt><b style="display: inline">bold</b></dt></dl>
3854 Definition lists: self-closed tag
3856 ;one<br/>two :two-line fun
3858 <dl><dt>one<br />two </dt>
3859 <dd>two-line fun</dd></dl>
3864 Definition lists: ignore colons inside tags
3866 ;one <b>two : tag <i>fun:</i>:</b>:def
3868 <dl><dt>one <b>two : tag <i>fun:</i>:</b></dt>
3874 Definition lists: excess closed tags
3876 ;one</b>two :bad tag fun
3878 <dl><dt>onetwo </dt>
3879 <dd>bad tag fun</dd></dl>
3883 <dd>bad tag fun</dd>
3888 T13748: Literal closing tags
3892 <dd>test test test test test</dd>
3894 <dd>test test test test test</dd>
3899 <dd>test test test test test</dd>
3901 <dd>test test test test test</dd>
3907 Definition and unordered list using wiki syntax nested in unordered list using html tags.
3915 <dl><dt>term </dt>
3916 <dd>description</dd></dl>
3917 <ul><li>unordered</li></ul>
3923 Definition list with empty definition and following paragraph
3936 Nested definition lists using html syntax
3949 Definition Lists: No nesting: Multiple dd's
3962 Definition Lists: Indentation: Regular
3970 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
3975 Definition Lists: Indentation: Missing 1st level
3981 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
3986 Definition Lists: Indentation: Multi-level indent
3990 <dl><dd><dl><dd><dl><dd>i3</dd></dl></dd></dl></dd></dl>
3995 Definition Lists: Hacky use to indent tables
4002 should be left alone
4004 <dl><dd><dl><dd><table>
4009 </td></tr></table></dd></dl></dd></dl>
4011 should be left alone
4016 Definition Lists: Hacky use to indent tables (with content following table)
4021 |} <!--c1--> this text should be part of the dl
4028 </td></tr></tbody></table> this text should be part of the dl</dd></dl>
4035 </td></tr></tbody></table> <!--c1--> this text should be part of the dl</dd></dl>
4039 Definition Lists: Hacky use to indent tables, with comments (T65979)
4047 should be left alone
4050 <dl><dd><dl><dd><table><tr>
4053 </tr></table><!-- bar --></dd></dl></dd></dl>
4055 should be left alone</p>
4059 Definition Lists: Hacky use to indent tables, with comment before table
4065 <dl><dd><dl><dd><!-- foo --><table><tr>
4067 </tr></table></dd></dl></dd></dl>
4070 # The trailing whitespace in this test is to catch a regression in
4071 # Parsoid after T54473.
4073 Definition Lists: Hacky use to indent tables (WS-insensitive)
4082 </td></tr></table></dd></dl>
4086 <tbody><tr><td>a</td></tr>
4087 </tbody></table> </dd></dl>
4090 ## The PHP parser treats : items (dd) without a corresponding ; item (dt)
4091 ## as an empty dt item. It also ignores all but the last ";" when followed
4092 ## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in
4093 ## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple
4096 ## Ex: ";;t2 ::d2" is transformed into:
4108 ## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
4109 ## So, the same wikitext above (;;t2 ::d2) is transformed into:
4120 ## All Parsoid only definition list tests have this difference.
4122 ## See also: https://phabricator.wikimedia.org/T8569
4123 ## and https://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html
4126 Table / list interaction: indented table with lists in table contents
4148 </td></tr></table></dd></dl>
4153 Table / list interaction: lists nested in tables nested in indented lists
4176 </td></tr></table></dd></dl>
4183 Definition Lists: Nesting: Multi-level (Parsoid only)
4211 Definition Lists: Nesting: Test 2
4218 <dl><dd>d2</dd></dl></dd></dl>