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.
83 MediaWiki:bad image list
85 * [[File:Bad.jpg]] except [[Nasty page]]
120 // For Serbian; localize Template namespace
128 Template:echo_with_span
134 Template:echo_with_div
140 Template:echo with depth
153 Template:table_attribs
156 |</noinclude>style="color:red;"|Foo
160 Template:table_attribs_2
163 |</noinclude>style="color:red;"|Foo
168 Template:table_attribs_3
171 |</noinclude>style{{=}}"background:#f9f9f9;"|Foo
175 Template:table_attribs_4
177 | style="background-color:#DC241f;" width="10px" |
181 Template:table_attribs_5
184 |</noinclude>style="color:red;"||Bar
188 Template:table_attribs_6
190 style="background: <nowiki>
197 Template:table_attribs_7
200 |</noinclude>style{{=}}"background:#f9f9f9;"|Foo<ref>foo</ref>
204 Template:table_header_cells
206 {{table_attribs}}!!style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz
212 {{table_attribs}}||style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz
216 Template:PartialTable
223 Template:image_attribs
226 [[File:foobar.jpg|</noinclude>right|Caption text<noinclude>]]</noinclude>
229 ## See T48811 for details
231 Template:mixed_attr_content_template
233 style="color:red;" title="T48811"
239 Template:definition_list
286 Template:EmptyTRWithHTMLAttrTest
289 <tr align="center"></tr>
290 <tr><td>foo</td></tr>
291 <tr align="center"></tr>
292 <tr><td>bar</td></tr>
315 This is a simple paragraph.
317 <p>This is a simple paragraph.
322 Paragraphs with extra newline spacing
345 Paragraphs with newline spacing with comment lines in between
353 <!--foo--><!--More than 1 comment, still stripped-->
357 <!--foo--> <!----> <!-- bar -->
418 Paragraphs with newline spacing with non-empty white-space lines in between
445 Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between
453 <!--foo--><!--More than 1 comment doesn't disable stripping of this line!-->
492 Extra newlines: More paragraphs with indented comment
507 Extra newlines followed by heading
522 <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>
523 <p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
526 <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>
531 Extra newlines between heading and content are swallowed
539 <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>
540 <p><a href="/index.php?title=A&action=edit&redlink=1" class="new" title="A (page does not exist)">a</a>
545 Heading with line break in nowiki
549 wgFragmentMode=[ 'html5', 'legacy' ]
554 <h2><span id="A_B.0AC"></span><span class="mw-headline" id="A_B
556 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>
560 C"><span id="A_B.0AC" typeof="mw:FallbackId"></span>A <span typeof="mw:Nowiki">B
567 http://fr.wikipedia.org/wiki/🍺
568 <!-- EasterEgg we love beer, better be able be able to link to it -->
570 <p><a rel="nofollow" class="external free" href="http://fr.wikipedia.org/wiki/🍺">http://fr.wikipedia.org/wiki/🍺</a>
589 *plain''italic''plain
590 *plain''italic''plain''italic''plain
591 *plain'''bold'''plain
592 *plain'''bold'''plain'''bold'''plain
593 *plain''italic''plain'''bold'''plain
594 *plain'''bold'''plain''italic''plain
595 *plain''italic'''bold-italic'''italic''plain
596 *plain'''bold''bold-italic''bold'''plain
597 *plain'''''bold-italic'''italic''plain
598 *plain'''''bold-italic''bold'''plain
599 *plain''italic'''bold-italic'''''plain
600 *plain'''bold''bold-italic'''''plain
601 *plain l'''italic''plain
602 *plain l''''bold''' plain
605 <li>plain<i>italic</i>plain</li>
606 <li>plain<i>italic</i>plain<i>italic</i>plain</li>
607 <li>plain<b>bold</b>plain</li>
608 <li>plain<b>bold</b>plain<b>bold</b>plain</li>
609 <li>plain<i>italic</i>plain<b>bold</b>plain</li>
610 <li>plain<b>bold</b>plain<i>italic</i>plain</li>
611 <li>plain<i>italic<b>bold-italic</b>italic</i>plain</li>
612 <li>plain<b>bold<i>bold-italic</i>bold</b>plain</li>
613 <li>plain<i><b>bold-italic</b>italic</i>plain</li>
614 <li>plain<b><i>bold-italic</i>bold</b>plain</li>
615 <li>plain<i>italic<b>bold-italic</b></i>plain</li>
616 <li>plain<b>bold<i>bold-italic</i></b>plain</li>
617 <li>plain l'<i>italic</i>plain</li>
618 <li>plain l'<b>bold</b> plain</li></ul>
622 # this example taken from the [[simple:Moon]] article (T49326)
624 Italics and possessives (1)
626 obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer
628 <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
632 # this example taken from [[en:Flaming Pie]] (T51926)
634 Italics and possessives (2)
636 '''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes
638 <p><i><b>Flaming Pie</b></i> is ... released in 1997. In <i>Flaming Pie'</i>s liner notes
642 # this example taken from [[en:Dictionary]] (T51926)
644 Italics and possessives (3)
646 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''.
648 <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>.
654 ### 2-quote opening sequence tests
657 Italics and bold: 2-quote opening sequence: (2,2)
666 Italics and bold: 2-quote opening sequence: (2,3)
675 Italics and bold: 2-quote opening sequence: (2,4)
685 # same html as previous, but wikitext adjusted to match parsoid html2wt
687 Italics and bold: 2-quote opening sequence: (2,4) w/ nowiki
689 ''foo<nowiki>''</nowiki>''
695 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
697 Italics and bold: 2-quote opening sequence: (2,5)
710 # same html as previous, but wikitext adjusted to match parsoid html2wt
712 Italics and bold: 2-quote opening sequence: (2,5+3) w/ nowiki
714 ''foo'''''<nowiki/>'''
725 ### 3-quote opening sequence tests
729 Italics and bold: 3-quote opening sequence: (3,2)
738 Italics and bold: 3-quote opening sequence: (3,3)
747 Italics and bold: 3-quote opening sequence: (3,4)
755 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
757 Italics and bold: 3-quote opening sequence: (3,5)
770 # same html as previous, but wikitext adjusted to match parsoid html2wt
772 Italics and bold: 3-quote opening sequence: (3,5+2) w/ nowiki
774 '''foo'''''<nowiki/>''
785 ### 4-quote opening sequence tests
789 Italics and bold: 4-quote opening sequence: (4,2)
799 # same html as previous, but wikitext adjusted to match parsoid html2wt
801 Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki
803 <nowiki>''</nowiki>''foo''
810 Italics and bold: 4-quote opening sequence: (4,3)
819 Italics and bold: 4-quote opening sequence: (4,4)
829 # same html as previous, but wikitext adjusted to match parsoid html2wt
831 Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki
839 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
841 Italics and bold: 4-quote opening sequence: (4,5)
850 <p>'<b>foo</b><i></i>
854 # same html as previous, but wikitext adjusted to match parsoid html2wt
856 Italics and bold: 4-quote opening sequence: (4,5+2) w/ nowiki
858 '<nowiki/>'''foo'''''<nowiki/>''
863 <p>'<b>foo</b><i></i>
869 ### 5-quote opening sequence tests
873 Italics and bold: 5-quote opening sequence: (5,2)
883 # same html as previous, but wikitext adjusted to match parsoid html2wt
885 Italics and bold: 5-quote opening sequence: (5,2+3)
894 Italics and bold: 5-quote opening sequence: (5,3)
904 # same html as previous, but wikitext adjusted to match parsoid html2wt
906 Italics and bold: 5-quote opening sequence: (5,3+2)
915 Italics and bold: 5-quote opening sequence: (5,4)
921 <p><i><b>foo'</b></i>
926 Italics and bold: 5-quote opening sequence: (5,5)
935 Italics and bold: 5-quote opening sequence: (5,6)
939 <p><i><b>foo'</b></i>
944 ### multiple quote sequences in a line
948 Italics and bold: multiple quote sequences: (2,4,2)
954 <p><i>foo'<b>bar</b></i>
958 # same html as previous, but wikitext adjusted to match parsoid html2wt
960 Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki
962 ''foo'<nowiki/>'''bar'''''
964 <p><i>foo'<b>bar</b></i>
969 Italics and bold: multiple quote sequences: (2,4,3)
975 <p><i>foo'<b>bar</b></i>
979 # same html as previous, but wikitext adjusted to match parsoid html2wt
981 Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki
983 ''foo'<nowiki/>'''bar'''''
985 <p><i>foo'<b>bar</b></i>
990 Italics and bold: multiple quote sequences: (2,4,4)
996 <p><i>foo'<b>bar'</b></i>
1000 # same html as previous, but wikitext adjusted to match parsoid html2wt
1002 Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki
1004 ''foo'<nowiki/>'''bar'<nowiki/>'''''
1006 <p><i>foo'<b>bar'</b></i>
1010 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
1012 Italics and bold: multiple quote sequences: (3,4,2)
1021 <p><b>foo'</b>bar<i></i>
1025 # same html as previous, but wikitext adjusted to match parsoid html2wt
1027 Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki
1029 '''foo''''bar''<nowiki/>''
1034 <p><b>foo'</b>bar<i></i>
1038 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
1040 Italics and bold: multiple quote sequences: (3,4,3)
1049 <p><b>foo'</b>bar<b></b>
1053 # same html as previous, but wikitext adjusted to match parsoid html2wt
1055 Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki
1057 '''foo''''bar'''<nowiki/>'''
1062 <p><b>foo'</b>bar<b></b>
1067 ### other quote tests
1070 Italics and bold: other quote tests: (2,3,5)
1072 ''this is about '''foo's family'''''
1074 <p><i>this is about <b>foo's family</b></i>
1080 Italics and bold: other quote tests: (2,(3,3),2)
1082 ''this is about '''foo's''' family''
1084 <p><i>this is about <b>foo's</b> family</i>
1090 Italics and bold: other quote tests: (3,2,3,2)
1094 '''this is about ''foo'''s family''
1096 <p><b>this is about <i>foo</i></b><i>s family</i>
1101 # same html as previous, but wikitext adjusted to match parsoid html2wt
1103 Italics and bold: other quote tests: (3,2,3+2+2,2)
1105 '''this is about ''foo'''''<nowiki/>''s family''
1107 <p><b>this is about <i>foo</i></b><i>s family</i>
1113 Italics and bold: other quote tests: (3,2,3,3)
1115 '''this is about ''foo'''s family'''
1117 <p>'<i>this is about </i>foo<b>s family</b>
1123 Italics and bold: other quote tests: (3,(2,2),3)
1125 '''this is about ''foo's'' family'''
1127 <p><b>this is about <i>foo's</i> family</b>
1133 Italicized possessive
1135 The ''[[Main Page]]'''s talk page.
1137 <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
1140 <p>The <i><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
1144 Quote balancing context should be restricted to td/th cells on the same wikitext line
1146 parsoid=wt2html,wt2wt
1160 </td></tr></tbody></table>
1168 Non-html5 tags should be accepted
1170 <center>''foo''</center>
1172 <font>''foo''</font>
1173 <strike>''foo''</strike>
1176 <center><i>foo</i></center>
1177 <p><big><i>foo</i></big>
1178 <font><i>foo</i></font>
1179 <strike><i>foo</i></strike>
1185 <wbr> is valid wikitext (T54468)
1193 # <strike> is HTML4, <s> is HTML4/5.
1195 <s> or <strike> for strikethrough
1197 <strike>strike</strike>
1201 <p><strike>strike</strike>
1209 Text-level semantic html elements in wikitext
1212 <strong>text</strong>
1228 <ruby><rb>明日</rb><rp>(</rp><rt>Ashita</rt><rp> </rp><rtc>あした</rtc><rp>)</rp></ruby>
1235 <strong>text</strong>
1251 <ruby><rb>明日</rb><rp>(</rp><rt>Ashita</rt><rp> </rp><rtc>あした</rtc><rp>)</rp></ruby>
1259 # test cases taken from
1260 # https://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element
1262 Ruby markup (W3C-style)
1264 ;Mono-ruby for individual base characters
1265 :<ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby>
1267 :<ruby>今日<rt>きょう</rt></ruby>
1269 :<ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby>
1271 :<ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby>
1273 :<ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby>
1276 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
1277 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
1278 <rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang="fr"><rt>Étoile</rt></rtc>
1281 <dl><dt>Mono-ruby for individual base characters</dt>
1282 <dd><ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby></dd>
1284 <dd><ruby>今日<rt>きょう</rt></ruby></dd>
1285 <dt>Jukugo ruby</dt>
1286 <dd><ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby></dd>
1287 <dt>Inline ruby</dt>
1288 <dd><ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby></dd>
1289 <dt>Double-sided ruby</dt>
1290 <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>
1292 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
1293 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
1294 <rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang="fr"><rt>Étoile</rt></rtc>
1299 # The next two test different paths in the sanitizer.
1301 Non-word characters don't terminate tag names (T19663, T42670, T54022)
1303 <blockquote|>a</blockquote>
1305 <b→> doesn't terminate </b→>
1307 <bä> doesn't terminate </bä>
1309 <boo> doesn't terminate </boo>
1311 <s.foo> doesn't terminate </s.foo>
1315 <p><blockquote|>a</blockquote>
1316 </p><p><b→> doesn't terminate </b→>
1317 </p><p><bä> doesn't terminate </bä>
1318 </p><p><boo> doesn't terminate </boo>
1319 </p><p><s.foo> doesn't terminate </s.foo>
1320 </p><p><sub-ID#1>
1325 Non-word characters don't terminate tag names
1327 <blockquote|>a</blockquote>
1329 <b→> doesn't terminate </b→>
1331 <bä> doesn't terminate </bä>
1333 <boo> doesn't terminate </boo>
1335 <s.foo> doesn't terminate </s.foo>
1339 <p><blockquote|>a
1340 </p><p><b→> doesn't terminate </b→>
1341 </p><p><bä> doesn't terminate </bä>
1342 </p><p><boo> doesn't terminate </boo>
1343 </p><p><s.foo> doesn't terminate </s.foo>
1344 </p><p><sub-ID#1>
1349 ### See tests/parser/parserTestsParserHook.php for the <tåg> extension)
1350 ### This checks that HTML5 tags (with non-word characters in the tag
1351 ### name) make it safely through the parser -- the Sanitizer will
1352 ### munge them later, as it should.
1355 Non-word characters are valid in extension tags (T19663)
1366 <pre typeof="mw:Extension/tåg" data-mw='{"name":"tåg","attrs":{},"body":{"extsrc":"tåg"}}' data-parsoid='{}' about="#mwt2"></pre>
1370 Isolated close tags should be treated as literal text (T54760)
1378 <p class="mw-empty-elt">
1379 </p><p><s.foo>s
1382 <p><s.foo>s</p>
1386 ### Special characters
1390 Bare pipe character (T54363)
1399 Bare pipe character from a template (T54363)
1408 ### <nowiki> test cases
1412 <nowiki> unordered list
1414 <nowiki>* This is not an unordered list item.</nowiki>
1416 <p>* This is not an unordered list item.
1419 <p><span typeof="mw:Nowiki">* This is not an unordered list item.</span></p>
1425 <nowiki>Lorem ipsum dolor
1433 <p>Lorem ipsum dolor
1442 <p><span typeof="mw:Nowiki">Lorem ipsum dolor
1452 Don't parse <nowiki><span class="error"></nowiki> (T149622)
1454 <nowiki><span class="error"></nowiki>
1456 <p><span class="error">
1459 <p><span typeof="mw:Nowiki"><span class="error"></span></p>
1465 :There is not nowiki.
1466 :There is <nowiki>nowiki</nowiki>.
1468 #There is not nowiki.
1469 #There is <nowiki>nowiki</nowiki>.
1471 *There is not nowiki.
1472 *There is <nowiki>nowiki</nowiki>.
1474 <dl><dd>There is not nowiki.</dd>
1475 <dd>There is nowiki.</dd></dl>
1476 <ol><li>There is not nowiki.</li>
1477 <li>There is nowiki.</li></ol>
1478 <ul><li>There is not nowiki.</li>
1479 <li>There is nowiki.</li></ul>
1482 <dl><dd data-parsoid='{}'>There is not nowiki.</dd>
1483 <dd data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</dd></dl>
1485 <ol><li data-parsoid='{}'>There is not nowiki.</li>
1486 <li data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</li></ol>
1488 <ul><li data-parsoid='{}'>There is not nowiki.</li>
1489 <li data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</li></ul>
1493 Entities inside <nowiki>
1495 <nowiki><</nowiki>
1500 <p><span typeof="mw:Nowiki"><span typeof="mw:Entity" data-parsoid='{"src":"&lt;","srcContent":"<"}'><</span></span></p>
1504 Entities inside template parameters
1511 <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>
1515 Properly escape nowiki when combined with other wiki markup
1519 <p>* </nowiki> tag</p>
1521 <nowiki>*</nowiki> <nowiki></nowiki></nowiki> tag
1525 T93824: Put escaped HTML tags inside nowiki
1529 <p><h2>foo</h2></p>
1531 <nowiki><h2>foo</h2></nowiki>
1535 T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars
1539 <p>This text: L'<a rel="mw:WikiLink" href="./Foo">Foo</a>
1540 This text: L''<a rel="mw:WikiLink" href="./Foo">Foo</a>
1541 This text: L'''<a rel="mw:WikiLink" href="./Foo">Foo</a>''</p>
1543 This text: L'[[Foo]]
1544 This text: L<nowiki>''</nowiki>[[Foo]]
1545 This text: L<nowiki>'''</nowiki>[[Foo]]<nowiki>''</nowiki>
1548 # This test fails because wikitext whitespace is not normalized before comparing.
1550 T71950: 2. Put nowiki as close to cause as possible, after ' :'
1554 <p>This text : L''<a rel="mw:WikiLink" href="./Foo">Foo</a>
1557 This text : L<nowiki>''</nowiki>[[Foo]]
1560 # This test and the next one are html2wt only as they test that incorrect wikitext
1561 # passed in template arguments gets escaped or wrapped in nowikis where required.
1563 T71482: Use {{!}} instead of nowiki for single pipe in template argument
1567 <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>
1568 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo|bar |[["}},"i":0}}]}" about="#mwt2"></p>
1570 {{echo|foo{{!}}bar}}
1571 {{echo|<nowiki>foo|bar |[[</nowiki>}}
1575 T53961: Output correct nowikis in template arguments
1579 <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>
1580 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }} b"}},"i":0}}]}" about="#mwt2"></span>
1581 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a [[ b"}},"i":0}}]}" about="#mwt3"></span>
1582 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a | {{ ]]"}},"i":0}}]}" about="#mwt4"></span>
1583 <span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }"}},"i":0}}]}" about="#mwt5"></span></p>
1586 {{echo|<nowiki>a }} b</nowiki>}}
1587 {{echo|<nowiki>a [[ b</nowiki>}}
1588 {{echo|<nowiki>a | {{ ]]</nowiki>}}
1589 {{echo|a <nowiki>}</nowiki>}}
1593 Cases where "!!" needs nowiki protection
1598 <tr><th>this needs protection !! here</th></tr>
1602 <tr><th>this does not need
1603 protection !! here</th></tr>
1607 !<nowiki>this needs protection !! here</nowiki>
1620 Comments and Indent-Pre
1622 <!-- comment 1 --> asdf
1624 <!-- comment 1 --> asdf
1627 <!-- comment 1 --> asdf
1628 <!-- comment 2 -->xyz
1630 <!-- comment 1 --> asdf
1631 <!-- comment 2 --> xyz
1687 asdf<!-- comment 1 -->jkl
1697 <!-- foo --> b <!-- bar -->
1711 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
1717 Comment semantics and delimiters
1719 <!-- --><!----><!-----><!------>
1723 <!-- --><!----><!-----><!------>
1727 Comment semantics and delimiters, redux
1729 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
1730 -- foo -- funky huh? ... -->
1734 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
1735 -- foo -- funky huh? ... -->
1739 Comment semantics and delimiters: directors cut
1741 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
1742 everything starting with < followed by !-- until the first -- and > we see,
1743 that wouldn't be valid XML however, since in XML -- has to terminate a comment
1749 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
1750 everything starting with < followed by !-- until the first -- and > we see,
1751 that wouldn't be valid XML however, since in XML -- has to terminate a comment
1756 Comment semantics: nesting
1758 <!--<!-- no, we're not going to do anything fancy here -->-->
1763 <!--<!-- no, we're not going to do anything fancy here --><p>--></p>
1766 # Parsoid closes the unclosed comment, even if it means a slight
1769 Comment semantics: unclosed comment at end
1771 parsoid=wt2html,html2html
1773 <!--This comment will run out to the end of the document
1777 <!--This comment will run out to the end of the document-->
1781 Comment semantics: normalize comments to play nice with XML and browsers
1783 <!-- Browsers --!> think this is closed -->
1784 <!--> This would normally be text -->
1785 <!---> As would this -->
1786 <!-- XML doesn't like trailing dashes -------->
1787 <!-- Nor doubled hyphens -- anywhere in the data -->
1788 But this is not a comment.
1790 <p>But this is not a comment.
1793 <!-- Browsers --!> think this is closed -->
1794 <!--> This would normally be text -->
1795 <!---> As would this -->
1796 <!-- XML doesn't like trailing dashes -------->
1797 <!-- Nor doubled hyphens -- anywhere in the data -->
1798 <p>But this is not a comment.</p>
1802 Comment semantics: round-trip even text which contains encoded -->
1804 <!-- hello & goodbye - > --> --&gt; --&xx -->
1806 <!-- hello & goodbye - > --> --&gt; --&xx -->
1810 Comment in template title
1819 Comment on its own line post-expand
1831 Comment on its own line post-expand with non-significant whitespace
1843 post-expand include size being exceeded
1847 {{echo3|1234567890}}
1849 <p><a href="/wiki/Template:Echo3" title="Template:Echo3">Template:Echo3</a><!-- WARNING: template omitted, post-expand include size too large -->
1854 max template depth being reached
1858 {{echo with depth|too deep!}}
1860 <p><span class="error">Template recursion depth limit exceeded (1)</span>
1865 Multiple comments should still parse as SOL-transparent
1867 parsoid=wt2html,wt2wt
1870 <!--c2--><!--c3--><!--c4-->*b
1879 <!--c2--><!--c3--><!--c4-->
1885 ## Make sure ">" gets escaped in comments to avoid XSS
1887 IE conditional comments
1890 <script>alert('hi');</script>
1893 <!--[if lt IE 9]>
1894 <script>alert('hi');</script>
1899 ### paragraph wrapping tests
1915 Block tag on one line (<div>)
1925 <p>a </p><div>foo</div>
1930 # Remex wraps empty tag runs with p-tags.
1931 # Parsoid strips them out during p-wrapping.
1933 No p-wrappable content
1935 <span><div>x</div></span>
1936 <span><s><div>x</div></s></span>
1937 <small><em></em></small><span><s><div>x</div></s></span>
1939 <span><div>x</div></span>
1940 <span><s><div>x</div></s></span>
1941 <p><small><em></em></small></p><span><s><div>x</div></s></span>
1943 <span><div>x</div></span>
1944 <span><s><div>x</div></s></span>
1945 <small><em></em></small><span><s><div>x</div></s></span>
1948 # T177612: Parsoid-only test
1950 Transclusion meta tags shouldn't trip Parsoid's useless p-wrapper stripping code
1952 {{echo|<span><div>x</div></span>}}
1955 <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>
1960 Block tag on one line (<blockquote>)
1962 a <blockquote>foo</blockquote>
1966 a <blockquote>foo</blockquote>
1970 <p>a </p><blockquote><p>foo</p></blockquote>
1976 Block tag on both lines (<div>)
1986 <p>a </p><div>foo</div><p>
1987 b </p><div>foo</div>
1991 Block tag on both lines (<blockquote>)
1993 a <blockquote>foo</blockquote>
1995 b <blockquote>foo</blockquote>
1997 a <blockquote>foo</blockquote>
1998 b <blockquote>foo</blockquote>
2001 <p>a </p><blockquote><p>foo</p></blockquote><p>
2002 b </p><blockquote><p>foo</p></blockquote>
2006 Multiple lines without block tags
2027 x </p><div>foo</div><p> z
2031 # The difference between Parsoid & Remex here
2032 # is because of Parsoid's Tidy-emulation code
2033 # for p-wrapping. We'll start work to remove this
2034 # emulation code in Parsoid sooner than later.
2035 # Remex wraps empty tag runs with p-tags.
2036 # Parsoid strips them out in a separate pass.
2038 Empty lines between lines with block tags
2073 </p><div>b</div><p>d
2078 <div data-parsoid='{"stx":"html"}'></div>
2081 <div data-parsoid='{"stx":"html"}'></div><p>a</p>
2084 <div data-parsoid='{"stx":"html"}'>a</div><p>b</p>
2086 <div data-parsoid='{"stx":"html"}'>b</div><p>d</p>
2089 <div data-parsoid='{"stx":"html"}'>e</div>
2093 Unclosed HTML p-tags should be handled properly
2100 <div><p>foo</p></div>
2105 <div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div>
2110 ## SSS FIXME: I can come up with other scenarios where this doesn't work because
2111 ## of eager output of buffered tokens in the p-wrapper. But, I'm going to ignore
2114 1. P-wrapping should leave sol-transparent tags outside p-tags where possible
2118 a [[Category:A1]] [[Category:A2]]
2123 <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"/>
2127 2. P-wrapping should leave sol-transparent tags outside p-tags where possible
2133 <link rel="mw:PageProp/Category" href="./Category:A1"/><p>a</p>
2137 No paragraph necessary for SOL transparent template
2139 <span><div>foo</div></span>
2142 <span><div>foo</div></span>
2143 {{echo|[[Category:Foo]]}}
2145 <span><div>foo</div></span>
2146 <span><div>foo</div></span>
2149 <span data-parsoid='{"stx":"html"}'><div data-parsoid='{"stx":"html"}'>foo</div></span>
2150 <link rel="mw:PageProp/Category" href="./Category:Foo"/>
2152 <span data-parsoid='{"stx":"html"}'><div data-parsoid='{"stx":"html"}'>foo</div></span>
2153 <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}}]}'/>
2157 Avoid expanding multiline sol transparent template ranges unnecessarily
2175 <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">
2178 <link rel="mw:PageProp/Category" href="./Category:Ho" />
2182 ### Preformatted text
2192 And a [[Main Page|link]]
2198 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
2203 Tabs don't trigger preformatted text
2207 This is preformatted text.
2213 <pre>This is preformatted text.
2218 preformatted text.</p>
2219 <pre>This is preformatted text.
2224 Space before tab needs nowiki pre protection
2230 <nowiki> </nowiki> a
2234 Ident preformatting with inline content
2245 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
2262 Regression with preformatted in <center>
2276 T54763: Preformatted in <blockquote>
2282 indented cell (no pre-wrapping!)
2292 <p> indented cell (no pre-wrapping!)
2300 T53086: Double newlines in blockquotes should be turned into paragraphs
2317 T17491: <ins>/<del> in blockquote
2320 Foo <del>bar</del> <ins>baz</ins> quux
2324 <p>Foo <del>bar</del> <ins>baz</ins> quux
2331 T17491: <ins>/<del> in blockquote (2)
2333 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
2336 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
2340 <blockquote><p>Foo </p><del>bar</del> <ins>baz</ins><p> quux
2345 <pre> with attributes (T5202)
2347 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
2349 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
2354 <pre> with width attribute (T5202)
2356 <pre width="8">Narrow screen goodies</pre>
2358 <pre width="8">Narrow screen goodies</pre>
2363 <pre> with forbidden attribute (T5202)
2365 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
2367 <pre width="8">Narrow screen goodies</pre>
2372 Entities inside <pre>
2381 <pre> with forbidden attribute values (T5202)
2383 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
2385 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
2390 <nowiki> inside <pre> (T15238)
2398 <pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>
2406 <pre><nowiki>Foo</nowiki></pre>
2411 <nowiki> inside of #tag:pre
2413 {{#tag:pre|Foo <nowiki>→bar</nowiki>}}
2415 <pre>Foo →bar</pre>
2418 <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>
2421 ## Don't expect this to rt, Parsoid drops the unmatched closing pre tags that
2422 ## aren't enclosed in nowikis.
2424 <nowiki> and <pre> preference (first one wins)
2455 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n<nowiki>\n"}}'><nowiki>
2460 <p><span typeof="mw:Nowiki">
2468 </pre> inside nowiki
2470 <nowiki></pre></nowiki>
2477 Empty pre; pre inside other HTML tags (T56946)
2494 <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
2496 <pre typeof="mw:Extension/pre" about="#mwt4" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":""}}'></pre>
2500 HTML pre followed by indent-pre
2513 <p><pre>foo</pre></p>
2515 <p class="mw-empty-elt"></p><pre>foo</pre><p class="mw-empty-elt"></p>
2517 <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>
2521 Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>
2529 Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>
2539 Templates: Indent-Pre: 1c: Wrapping should be based on expanded content
2551 Templates: Indent-Pre: 1d: Wrapping should be based on expanded content
2572 Templates: Indent-Pre: 1e. Wrapping should be based on expanded content
2576 {{echo| foo}}{{echo| bar}}
2581 {{echo|<!--cmt--> foo}}
2583 <!--cmt-->{{echo| foo}}
2585 {{echo|{{echo| }}bar}}
2603 Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
2639 ## Hmm, should Parsoid rt this?
2641 Pres with newline attributes
2643 parsoid=wt2html,html2html
2648 <pre class="one two">hi</pre>
2651 <pre typeof="mw:Extension/pre" about="#mwt2" class="one two" data-mw='{"name":"pre","attrs":{"class":"one two"},"body":{"extsrc":"hi"}}'>hi</pre>
2655 Things that look like <pre> tags aren't treated as such
2657 Barack Obama <President> of the United States
2658 <President></President>
2660 <p>Barack Obama <President> of the United States
2661 <President></President>
2666 Handle broken pre-like tags (T66025)
2670 {{echo|<pre <pre>x</pre>}}
2672 <table><pre </table>
2675 <table><pre </table>
2679 <pre <table></table>
2681 <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>
2690 Parsoid: handle pre with space after attribute
2694 <pre style="width:50%;" >{{echo|foo}}</pre>
2696 <pre style="width:50%;">{{echo|foo}}</pre>
2699 <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>
2702 # TODO / maybe: fix wt2wt for this
2704 Parsoid: Don't paragraph-wrap fosterable content
2737 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":null}'></pre>
2741 Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
2769 #--------------------------------------------------------------------
2770 # Transclusion parameter whitespace stripping tests
2771 # Behavior is different for positional and named parameters
2772 #--------------------------------------------------------------------
2774 Templates: Strip leading and trailing whitespace from named-param values
2778 {{echo|1= {{echo|b}} }}
2796 Templates: Don't strip whitespace from positional-param values
2800 {{echo|{{echo|b}} }}
2840 Templates: Don't recognize targets split by newlines
2856 Templates: Recognize targets when newlines and comments don't split the target
2861 <!--X--> ech<!--X-->o<!--X-->
2869 <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>
2873 Templates: Handle empty comment-and-ws-only lines correctly
2876 <!--should be ignored-->
2877 <!--should be ignored as well-->
2884 <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>
2888 Templates: Handle comments in the target
2891 <!-- should be ignored -->
2895 <!-- should be ignored and spaces on next line should not trip us up (T147742) -->
2898 {{echo<!-- should be ignored -->
2901 {{echo<!-- should be ignored -->|foo}}
2903 {{<!-- should be ignored -->echo|foo}}
2912 <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>
2914 <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>
2916 <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>
2918 <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>
2920 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
2924 Templates: Handle comments in parameter names (T69657)
2927 <!-- should be ignored -->
2931 <!-- should be ignored -->
2934 {{echo|1<!-- should be ignored -->=foo}}
2936 {{echo|<!-- should be ignored -->1=foo}}
2944 <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>
2946 <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>
2948 <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>
2950 <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>
2954 Templates: Other wikitext in parameter names (T69657)
2961 <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"''1''":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p>
2965 Templates: With colons
2969 <p>Template with colon
2972 <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>
2975 #--------------------------------------------------------------------
2976 # Transclusion parameter escaping tests
2977 #--------------------------------------------------------------------
2980 Templates: Parsoid parameter escaping test 1
2982 {{echo|[foo]|{{echo|[bar]}}}}
2987 <p about="#mwt1" typeof="mw:Transclusion"
2988 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}}]}'>[foo]</p>
2992 Parsoid: Pipes in external links in template parameter
2994 {{echo|[{{echo|http://example.com}} link]}}
2996 <p><a rel="nofollow" class="external text" href="http://example.com">link</a>
2999 <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>
3003 Parsoid: pipe in transclusion parameter
3005 {{echo|http://foo.com/a|b}}
3007 <p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a>
3010 <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>
3014 Parsoid: Pipe in external link target and content in template parameter
3016 parsoid=html2wt,wt2wt
3018 {{echo|[http://foo.com/a|b a|b]}}
3020 <p><a rel="nofollow" class="external text" href="http://foo.com/a%7Cb">a|b</a>
3023 <p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
3024 typeof="mw:Transclusion"
3025 data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
3026 "params":{"1":{"wt":"[http://foo.com/a|b a|b]"}},"i":0}}]}'>a|b</a></p>
3030 Parsoid: Pipe in template with nested template in external link target in template parameter (seriously)
3034 {{echo|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}
3036 <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>
3040 Templates: Don't escape already nowiki-escaped text in template parameters
3042 parsoid=html2wt,wt2wt
3044 {{echo|foo<nowiki>|</nowiki>bar}}
3045 {{echo|<nowiki><div></nowiki>}}
3046 {{echo|<nowiki></nowiki>}}
3053 <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>
3054 <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>
3055 <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>
3061 Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param
3063 parsoid=html2wt,wt2wt
3065 {{echo|{{echo|1=bar}}}}
3070 <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>
3075 Templates parameters with special tokenizing behavior dont get modified because of arg escaping
3082 <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>
3087 Templates: Preserve blank parameter names
3094 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p>
3098 Templates: Preserve blank parameter names in other positions
3100 {{blank_param|bar|=foo}}
3106 <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
3111 ### Parsoid-centric tests for testing RT edge cases for pre
3115 1a. Indent-Pre and Comments
3128 1b. Indent-Pre and Comments
3141 1c. Indent-Pre and Comments
3154 1d. Indent-Pre and Comments
3155 (Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order)
3168 2a. Indent-Pre and tables
3189 2b. Indent-Pre and tables
3205 2c. Indent-Pre and tables (T44252)
3222 2d. Indent-Pre and tables
3239 <tbody><tr><td> b</td></tr>
3244 2e. Indent-Pre and table-line syntax
3257 2f. Indent-pre started by table-line syntax
3276 2g. Indented table markup mixed with indented pre content (proposed in T8200)
3281 Text that should be rendered preformatted
3289 <pre>Text that should be rendered preformatted
3298 3a. Indent-Pre and block tags (single-line html)
3302 c <blockquote> foo </blockquote>
3307 c <blockquote> foo </blockquote>
3308 <pre><span> foo </span>
3311 <p>a </p><p data-parsoid='{"stx":"html"}'> foo </p>
3312 <p>b </p><div data-parsoid='{"stx":"html"}'> foo </div>
3313 <p>c </p><blockquote data-parsoid='{"stx":"html"}'> foo </blockquote>
3314 <pre><span> foo </span>
3317 <p> a </p><p> foo </p><p>
3318 b </p><div> foo </div><p>
3319 c </p><blockquote><p> foo </p></blockquote>
3320 <pre><span> foo </span>
3325 3b. Indent-Pre and block tags (multi-line html)
3330 <pre>a <span>foo</span>
3335 <pre>a <span data-parsoid='{"stx":"html"}'>foo</span></pre>
3336 b <div data-parsoid='{"stx":"html"}'> foo </div>
3338 <pre>a <span>foo</span>
3340 b </p><div> foo </div>
3344 3c. Indent-Pre and block tags (pre-content on separate line)
3408 4. Indent-Pre and extension tags
3419 a <pre typeof="mw:Extension/tag" about="#mwt2" data-parsoid='{}' data-mw='{"name":"tag","attrs":{},"body":null}'></pre>
3423 5. Indent-Pre and html pre
3425 <pre class="123">hi</pre>
3427 <pre class="123">hi</pre>
3430 <pre typeof="mw:Extension/pre" about="#mwt2" class="123" data-mw='{"name":"pre","attrs":{"class":"123"},"body":{"extsrc":"hi"}}'>hi</pre>
3434 Render paragraphs when indent-pre is suppressed in blocklevels
3451 4. Multiple spaces at start-of-line
3469 ## NOTE: the leading white-space chars on empty line are significant
3471 5a. White-space in indent-pre
3483 ## NOTE: the leading white-space chars on empty line are significant
3485 5b. White-space in indent-pre
3504 5c. White-space in indent-pre
3517 6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content
3540 7a. Indent-pre and category links
3542 parsoid=wt2html,wt2wt
3544 [[Category:foo]] <!-- No pre-wrapping -->
3545 {{echo| [[Category:foo]]}} <!-- No pre-wrapping -->
3548 <link rel="mw:PageProp/Category" href="./Category:Foo"> <!-- No pre-wrapping -->
3549 <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 -->
3552 ## We used to, but no longer wt2wt this test since the default serializer
3553 ## will normalize all categories to serialize on their own line.
3554 ## This wikitext usage is going to be fairly uncommon in production and
3555 ## selser will take care of preserving formatting in those scenarios.
3557 7b. Indent-pre and category links
3562 [[Category:foo]] {{echo|b}}
3564 <pre><link rel="mw:PageProp/Category" href="./Category:Foo"> a
3565 <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>
3569 Indent-Pre: Newlines in comments shouldn't affect sol state
3584 ### HTML-pre (some to spec PHP parser behavior and some Parsoid-RT-centric)
3588 HTML-pre: 1. embedded newlines
3620 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre>
3622 <pre typeof="mw:Extension/pre" about="#mwt4" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\nfoo\n"}}'>foo
3625 <pre typeof="mw:Extension/pre" about="#mwt6" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n\nfoo\n"}}'>
3630 <pre typeof="mw:Extension/pre" about="#mwt8" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n\n\nfoo\n"}}'>
3638 HTML-pre: big spaces
3674 <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"}}'>
3693 HTML-pre: 2: indented text
3706 HTML-pre: 3: other wikitext
3725 <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
3734 ### Definition lists
3741 <dl><dt>name </dt>
3742 <dd>Definition</dd></dl>
3747 Definition list for indentation only
3751 <dl><dd>Indented text</dd></dl>
3756 Definition list with no space
3761 <dd>Definition</dd></dl>
3766 Definition list with URL link
3768 ;http://example.com/ :definition
3770 <dl><dt><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> </dt>
3771 <dd>definition</dd></dl>
3776 Definition list with bracketed URL link
3778 ;[http://www.example.com/ Example]:Something about it
3780 <dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt>
3781 <dd>Something about it</dd></dl>
3786 Definition list with wikilink containing colon
3788 ; [[Help:FAQ]]:The least-read page on Wikipedia
3790 <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>
3791 <dd>The least-read page on Wikipedia</dd></dl>
3795 # At Brion's and JeLuF's insistence... :)
3797 Definition list with news link containing colon
3799 ;news:alt.wikipedia.rox: This isn't even a real newsgroup!
3801 <dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
3802 <dd>This isn't even a real newsgroup!</dd></dl>
3805 <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>
3809 Malformed definition list with colon
3811 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
3813 <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>
3818 Definition lists: colon in external link text
3820 ;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up
3822 <dl><dt><a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia :The Next Generation</a> </dt>
3823 <dd>OK, I made that up</dd></dl>
3828 Definition lists: colon in HTML attribute
3830 ;<b style="display: inline">bold</b>
3832 <dl><dt><b style="display: inline">bold</b></dt></dl>
3837 Definition lists: self-closed tag
3839 ;one<br/>two :two-line fun
3841 <dl><dt>one<br />two </dt>
3842 <dd>two-line fun</dd></dl>
3847 Definition lists: ignore colons inside tags
3849 ;one <b>two : tag <i>fun:</i>:</b>:def
3851 <dl><dt>one <b>two : tag <i>fun:</i>:</b></dt>
3857 Definition lists: excess closed tags
3859 ;one</b>two :bad tag fun
3861 <dl><dt>onetwo </dt>
3862 <dd>bad tag fun</dd></dl>
3866 <dd>bad tag fun</dd>
3871 T13748: Literal closing tags
3875 <dd>test test test test test</dd>
3877 <dd>test test test test test</dd>
3882 <dd>test test test test test</dd>
3884 <dd>test test test test test</dd>
3890 Definition and unordered list using wiki syntax nested in unordered list using html tags.
3898 <dl><dt>term </dt>
3899 <dd>description</dd></dl>
3900 <ul><li>unordered</li></ul>
3906 Definition list with empty definition and following paragraph
3919 Nested definition lists using html syntax
3932 Definition Lists: No nesting: Multiple dd's
3945 Definition Lists: Indentation: Regular
3953 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
3958 Definition Lists: Indentation: Missing 1st level
3964 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
3969 Definition Lists: Indentation: Multi-level indent
3973 <dl><dd><dl><dd><dl><dd>i3</dd></dl></dd></dl></dd></dl>
3978 Definition Lists: Hacky use to indent tables
3985 should be left alone
3987 <dl><dd><dl><dd><table>
3992 </td></tr></table></dd></dl></dd></dl>
3994 should be left alone
3999 Definition Lists: Hacky use to indent tables (with content following table)
4004 |} <!--c1--> this text should be part of the dl
4011 </td></tr></tbody></table> this text should be part of the dl</dd></dl>
4018 </td></tr></tbody></table> <!--c1--> this text should be part of the dl</dd></dl>
4022 Definition Lists: Hacky use to indent tables, with comments (T65979)
4030 should be left alone
4033 <dl><dd><dl><dd><table><tr>
4036 </tr></table><!-- bar --></dd></dl></dd></dl>
4038 should be left alone</p>
4042 Definition Lists: Hacky use to indent tables, with comment before table
4048 <dl><dd><dl><dd><!-- foo --><table><tr>
4050 </tr></table></dd></dl></dd></dl>
4053 # The trailing whitespace in this test is to catch a regression in
4054 # Parsoid after T54473.
4056 Definition Lists: Hacky use to indent tables (WS-insensitive)
4065 </td></tr></table></dd></dl>
4069 <tbody><tr><td>a</td></tr>
4070 </tbody></table> </dd></dl>
4073 ## The PHP parser treats : items (dd) without a corresponding ; item (dt)
4074 ## as an empty dt item. It also ignores all but the last ";" when followed
4075 ## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in
4076 ## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple
4079 ## Ex: ";;t2 ::d2" is transformed into:
4091 ## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
4092 ## So, the same wikitext above (;;t2 ::d2) is transformed into:
4103 ## All Parsoid only definition list tests have this difference.
4105 ## See also: https://phabricator.wikimedia.org/T8569
4106 ## and https://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html
4109 Table / list interaction: indented table with lists in table contents
4131 </td></tr></table></dd></dl>
4136 Table / list interaction: lists nested in tables nested in indented lists
4159 </td></tr></table></dd></dl>
4166 Definition Lists: Nesting: Multi-level (Parsoid only)
4194 Definition Lists: Nesting: Test 2
4201 <dl><dd>d2</dd></dl></dd></dl>
4206 Definition Lists: Nesting: Test 3
4211 <dl><dd><dl><dt>t1</dt>
4213 <dl><dd><dl><dd>d2</dd></dl></dd></dl></dd></dl></dd></dl>
4218 Definition Lists: Nesting: Test 4
4223 <dl><dd><dl><dd><dl><dt>t3</dt>
4224 <dd>d3</dd></dl></dd></dl></dd></dl>
4229 ## The Parsoid team believes the following three test exposes a
4230 ## bug in the PHP parser. (Parsoid team thinks the PHP parser is
4231 ## wrong to close the <dl> after the <dt> containing the <ul>.)
4232 ## It also exposes a "misfeature" in tidy, which doesn't like
4233 ## <dl> tags with a single <dt> child; it converts the <dt> into
4234 ## a <dd> in that case. (Parsoid leaves the <dt> alone!)
4236 Definition Lists: Mixed Lists: Test 1
4242 <dl><dd><dl><dt><ul><li>foo</li>
4243 <li>bar</li></ul></dt></dl>
4244 <dl><dt>baz</dt></dl></dd></dl>
4247 <dl><dd><dl><dt><ul><li>foo</li>
4248 <li>bar</li></ul></dt></dl>
4249 <dl><dt>baz</dt></dl></dd></dl>
4267 Definition Lists: Mixed Lists: Test 2
4272 <ul><li><dl><dd>d1</dd>
4273 <dd>d2</dd></dl></li></ul>
4279 Definition Lists: Mixed Lists: Test 3
4284 <ul><li><dl><dd><dl><dd><dl><dd>d1</dd>
4285 <dd>d2</dd></dl></dd></dl></dd></dl></li></ul>
4291 Definition Lists: Mixed Lists: Test 4
4296 <ul><li><dl><dt>d1 </dt>
4299 <dd>d4</dd></dl></li></ul>
4305 Definition Lists: Mixed Lists: Test 5
4311 <dl><dd>d2</dd></dl></dd></dl></li></ul>
4317 Definition Lists: Mixed Lists: Test 6
4322 <ol><li><ul><li><dl><dd>d1
4323 <dl><dd><dl><dd>d3</dd></dl></dd></dl></dd></dl></li></ul></li></ol>
4329 Definition Lists: Mixed Lists: Test 7
4334 <dl><dd><ul><li>d1</li>
4335 <li>d2</li></ul></dd></dl>
4341 Definition Lists: Mixed Lists: Test 8
4346 <dl><dd><ul><li>d1</li></ul>
4347 <dl><dd><ul><li>d2</li></ul></dd></dl></dd></dl>
4353 Definition Lists: Mixed Lists: Test 9
4357 <ul><li><dl><dt>foo </dt>
4358 <dd>bar</dd></dl></li></ul>
4364 Definition Lists: Mixed Lists: Test 10
4368 <ul><li><ol><li><dl><dt>foo </dt>
4369 <dd>bar</dd></dl></li></ol></li></ul>
4373 # The Parsoid team disagrees with the PHP parser's seemingly-random
4374 # rules regarding dd/dt on the next few tests. Parsoid is more
4375 # consistent, and recognizes the shared nesting and keeps the
4376 # still-open tags around until the nesting is complete.
4378 # This is a regression test for T175099
4380 Definition Lists: Mixed Lists: Test 11
4387 <ul><li>b</li></ul></dd></dl>
4391 <dd><ul><li>b</li></ul></dd></dl>
4394 # FIXME: Maybe get rid of this test?
4396 Definition Lists: Mixed Lists: Test 12
4401 <ul><li><ol><li><ul><li><ol><li><dl><dt>foo </dt>
4402 <dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dd></dl></li></ul></dd></dl>
4403 <dl><dt>boo </dt>
4404 <dd>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>
4407 <ul><li><ol><li><ul><li><ol><li><dl><dt>foo </dt>
4408 <dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dt></dl></li></ul></dd></dl></li></ol></li></ul>
4409 <dl><dt>boo </dt>
4410 <dd>baz</dd></dl></li></ol></li></ul>
4427 <dt>foo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
4428 <dd data-parsoid='{"stx":"row"}'>bar</dd>
4432 <dt>boo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
4433 <dd data-parsoid='{"stx":"row"}'>baz</dd>
4441 # FIXME: Maybe get rid of this test?
4443 # * The test is wrong, there are two colons where there should be :;
4444 # * The PHP parser is wrong to close the <dl> after the <dt> containing the <ul>.
4446 Definition Lists: Weird Ones: Test 1
4448 *#;*::;;foo :bar (who uses this?)
4450 <ul><li><ol><li><dl><dt>foo </dt>
4451 <dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt>bar (who uses this?)</dt></dl></dt></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul>
4468 <dt>foo<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"src":" ","isDisplayHack":true}'> </span></dt>
4469 <dd data-parsoid='{"stx":"row"}'>bar (who uses this?)</dd>
4481 Definition Lists: colons occurring in tags
4498 <dt><span>a:b</span></dt>
4499 <dt><div>a:b</div></dt>
4500 <dt><div>a</div></dt>
4504 <dt><i>a:b</i></dt></dl>
4505 <dl><dt><dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl>
4507 <dl><dt>a</dt><dd data-parsoid='{"stx":"row"}'>b</dd>
4509 <dt><i data-parsoid='{"stx":"html"}'>a:b</i></dt>
4510 <dt><span data-parsoid='{"stx":"html"}'>a:b</span></dt>
4511 <dt><div data-parsoid='{"stx":"html"}'>a:b</div></dt>
4512 <dt><div data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a</div></dt>
4514 <dt><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a:b"}},"i":0}}]}'>a:b</span></dt>
4515 <dt><i about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"''a:b''"}},"i":0}}]}'>a:b</i>
4516 <dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl>
4519 # Parsoid's output differs here again because it shares
4520 # nesting between the two lists unlike the PHP parser.
4521 # Unsure which is more desirable.
4523 Definition Lists: colons and tables 1
4535 </td></tr></table></dd></dl>
4539 </td></tr></table></dd></dl>
4545 </td></tr></table></dd>
4549 </td></tr></table></dd></dl>
4552 # FIXME: Does this need a html/php section?
4554 Definition Lists: template interaction
4556 ::{{definition_list}}
4559 ::{{definition_list}}
4564 <dl><dd><dl data-parsoid='{}'><dd about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[":",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}}]}'>one</dd><span about="#mwt1">
4565 </span><dd about="#mwt1">two</dd></dl></dd></dl>
4567 <dl><dd data-parsoid='{}'>one
4568 <dl><dd about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":["::",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}},"\n:::two\n:::three"]}'>one</dd><span about="#mwt2">
4569 </span><dd about="#mwt2">two
4571 <dd>three</dd></dl></dd>
4572 <dd data-parsoid='{}'>four</dd></dl></dd></dl>
4580 External links: non-bracketed
4582 Non-bracketed: http://example.com
4584 <p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
4588 # parsoid doesn't explicitly mark autonumbered links, see T55505
4590 External links: numbered
4592 Numbered: [http://example.com]
4593 Numbered: [http://example.net]
4594 Numbered: [http://example.com]
4596 <p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
4597 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
4598 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
4601 <p>Numbered: <a rel="mw:ExtLink" class="external autonumber" href="http://example.com"></a>
4602 Numbered: <a rel="mw:ExtLink" class="external autonumber" href="http://example.net"></a>
4603 Numbered: <a rel="mw:ExtLink" class="external autonumber" href="http://example.com"></a></p>
4607 External links: specified text
4609 Specified text: [http://example.com link]
4611 <p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
4616 External links: trail
4618 Linktrails should not work for external links: [http://example.com link]s
4620 <p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
4625 External links: dollar sign in URL
4627 http://example.com/1$2345
4629 <p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
4633 # parsoid doesn't explicitly mark autonumbered links, see T55505
4635 External links: dollar sign in URL (autonumber)
4637 [http://example.com/1$2345]
4639 <p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
4642 <p><a rel="mw:ExtLink" class="external autonumber" href="http://example.com/1$2345"></a></p>
4646 External links: open square bracket forbidden in URL (T6377)
4648 parsoid=wt2html,wt2wt,html2html
4650 http://example.com/1[2345
4652 <p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
4655 <p><a rel="mw:ExtLink" class="external free" href="http://example.com/1">http://example.com/1</a>[2345</p>
4659 External links: open square bracket forbidden in URL (named) (T6377)
4661 parsoid=wt2html,html2html
4663 [http://example.com/1[2345]
4665 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
4668 <p><a rel="mw:ExtLink" class="external text" href="http://example.com/1">[2345</a></p>
4671 # parsoid adds a space before the link name
4673 External links: open square bracket forbidden in URL (named) (T6377)
4676 [http://example.com/1 [2345]
4678 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
4683 External links: nowiki in URL link text (T8230)
4685 [http://example.com/ <nowiki>''example site''</nowiki>]
4687 <p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
4692 External links: newline forbidden in text (T8230 regression check)
4694 [http://example.com/ first
4697 <p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
4703 External links: Pipe char between url and text
4705 [http://example.com | link]
4707 <p><a rel="nofollow" class="external text" href="http://example.com">| link</a>
4712 External links: protocol-relative URL in brackets
4714 [//example.com/ Test]
4716 <p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
4720 # parsoid doesn't explicitly mark autonumbered links, see T55505
4722 External links: protocol-relative URL in brackets without text
4726 <p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
4729 <p><a rel="mw:ExtLink" class="external autonumber" href="//example.com"></a></p>
4733 External links: protocol-relative URL in free text is left alone
4737 <p>//example.com/Foo
4742 External links: protocol-relative URL in the middle of a word is left alone (T32269)
4744 foo//example.com/Foo
4746 <p>foo//example.com/Foo
4750 ## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
4752 External links: with no contents
4754 parsoid=wt2html,wt2wt
4756 [http://en.wikipedia.org/wiki/Foo]
4758 [[wikipedia:Foo|Bar]]
4760 [[wikipedia:Foo|<span>Bar</span>]]
4762 <p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/wiki/Foo">[1]</a>
4763 </p><p><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo">Bar</a>
4764 </p><p><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo"><span>Bar</span></a>
4767 <p><a rel="mw:ExtLink" class="external autonumber" href="http://en.wikipedia.org/wiki/Foo"></a></p>
4768 <p><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo">Bar</a></p>
4769 <p><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo"><span>Bar</span></a></p>
4773 External links: Free with trailing punctuation
4783 http://example.com/url_with_(brackets)
4784 (http://example.com/url_without_brackets)
4785 http://example.com/url_with_entity&
4786 http://example.com/url_with_entity&
4787 http://example.com/url_with_entity&
4788 http://example.com/url_with_entity
4789 http://example.com/url_with_entity 
4790 http://example.com/url_with_entity 
4791 http://example.com/url_with_entity<
4792 http://example.com/url_with_entity<
4793 http://example.com/url_with_entity<
4795 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>,
4796 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>;
4797 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>\
4798 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>.
4799 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>:
4800 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>!
4801 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>?
4802 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
4803 <a rel="nofollow" class="external free" href="http://example.com/url_with_(brackets)">http://example.com/url_with_(brackets)</a>
4804 (<a rel="nofollow" class="external free" href="http://example.com/url_without_brackets">http://example.com/url_without_brackets</a>)
4805 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4806 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4807 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4808 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
4809 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
4810 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
4811 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
4812 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
4813 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
4816 <p><a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>,
4817 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>;
4818 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>\
4819 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>.
4820 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>:
4821 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>!
4822 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>?
4823 <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a>)
4824 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_(brackets)">http://example.com/url_with_(brackets)</a>
4825 (<a rel="mw:ExtLink" class="external free" href="http://example.com/url_without_brackets">http://example.com/url_without_brackets</a>)
4826 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4827 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4828 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
4829 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span>
4830 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#xA0;","srcContent":" "}'> </span>
4831 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#160;","srcContent":" "}'> </span>
4832 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&lt;","srcContent":"<"}'><</span>
4833 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#x3C;","srcContent":"<"}'><</span>
4834 <a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#60;","srcContent":"<"}'><</span></p>
4838 External links: tricky Parsoid html2html case
4840 parsoid=wt2html,wt2wt,html2html
4842 http://example.com/url_with_entity&amp;
4844 <p><a rel="nofollow" class="external free" href="http://example.com/url_with_entity&amp">http://example.com/url_with_entity&amp</a>;
4847 <p><a rel="mw:ExtLink" class="external free" href="http://example.com/url_with_entity&amp">http://example.com/url_with_entity&amp</a>;</p>
4851 External links: Free with trailing quotes (T113666)
4853 '''News:''' Stuff here
4857 <p><b>News:</b> Stuff here
4858 </p><p><a rel="nofollow" class="external free" href="news:'a'b">news:'a'b</a><i>c</i>d e
4861 <p><b>News:</b> Stuff here</p>
4862 <p><a rel="mw:ExtLink" class="external free" href="news:'a'b">news:'a'b</a><i>c</i>d e</p>
4866 External links: with entity
4868 [http:// www.librarieswithoutborders.org Libraries without borders]
4870 <p><a rel="nofollow" class="external text" href="http://+www.librarieswithoutborders.org">Libraries without borders</a>
4873 <p><a rel="mw:ExtLink" class="external text" href="http://+www.librarieswithoutborders.org" data-parsoid='{"a":{"href":"http://+www.librarieswithoutborders.org"},"sa":{"href":"http://&#x20;www.librarieswithoutborders.org"}}'>Libraries without borders</a></p>
4877 External links: Lone protocols are never linked (T105697)
4896 External links: No preceding word characters allowed (T67278)
4898 NOPEhttp://example.com
4899 N0http://example.com
4900 ok:http://example.com
4901 ok-http://example.com
4903 <p>NOPEhttp://example.com
4904 N0http://example.com
4905 ok:<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
4906 ok-<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
4911 External links: nofollow domain exception
4913 A [https://no-nofollow.org/foobar link], and another [https://example.org link].
4915 <p>A <a class="external text" href="https://no-nofollow.org/foobar">link</a>, and another <a rel="nofollow" class="external text" href="https://example.org">link</a>.
4922 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
4924 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png"/>
4929 External image from https
4931 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
4933 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png"/>
4938 External image (when not allowed)
4940 wgAllowExternalImages=0
4942 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
4944 <p>External image: <a rel="nofollow" class="external free" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
4949 Link to non-http image, no img tag
4951 Link to non-http image, no img tag: ftp://example.com/test.jpg
4953 <p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
4958 External links: terminating separator
4960 Terminating separator: http://example.com/thing,
4962 <p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
4967 External links: intervening separator
4969 Intervening separator: http://example.com/1,2,3
4971 <p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
4976 External links: old bug with URL in query
4978 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
4980 <p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
4985 External links: old URL-in-URL bug, mixed protocols
4987 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
4989 <p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
4993 # Since Parsoid is starting to emit canonical wikitext for links,
4994 # [http://example.com http://example.com] will not RT back to that
4997 External links: URL in text
5001 URL in text: [http://example.com http://example.com]
5003 <p>URL in text: <a rel="nofollow" class="external text" href="http://example.com">http://example.com</a>
5006 <p>URL in text: <a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a></p>
5010 External links: Clickable images
5012 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
5014 <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png"/></a>
5017 <p>ja-style clickable images: <a rel="mw:ExtLink" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" data-parsoid='{"type":"extlink"}'/></a></p>
5021 External links: raw ampersand
5023 Old & use: http://x&y
5025 <p>Old & use: <a rel="nofollow" class="external free" href="http://x&y">http://x&y</a>
5030 External links: encoded ampersand
5032 Old & use: http://x&y
5034 <p>Old & use: <a rel="nofollow" class="external free" href="http://x&y">http://x&y</a>
5037 <p>Old <span typeof="mw:Entity">&</span> use: <a rel="mw:ExtLink" class="external free" href="http://x&y">http://x&y</a></p>
5041 External links: encoded equals (T8102)
5043 http://example.com/?foo=bar
5045 <p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
5048 <p><a rel="mw:ExtLink" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a></p>
5052 ## Note that parsoid doesn't explicit mark autonumbered links, nor
5053 ## does it number them. As discussed in T55505, we can identify
5054 ## autonumbered links via CSS.
5058 External links: [raw ampersand]
5060 Old & use: [http://x&y]
5062 <p>Old & use: <a rel="nofollow" class="external autonumber" href="http://x&y">[1]</a>
5065 <p>Old <span typeof="mw:Entity">&</span> use: <a rel="mw:ExtLink" class="external autonumber" href="http://x&y"></a></p>
5068 # note that parsoid html is identical to [raw ampersand] case; so html2wt
5069 # mode will return the [raw ampersand] wikitext