1 # MediaWiki Parser test cases
2 # Some taken from http://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 # ill add inter-language links
18 # subpage enable subpages (disabled by default)
19 # title=[[XXX]] run test using article title XXX
20 # disabled do not run test
22 # For testing purposes, temporary articles can created:
23 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
24 # where '/' denotes a newline.
26 # This is the standard article assumed to exist.
46 This is a simple paragraph.
48 <p>This is a simple paragraph.
68 * plain''italic''plain
69 * plain''italic''plain''italic''plain
70 * plain'''bold'''plain
71 * plain'''bold'''plain'''bold'''plain
72 * plain''italic''plain'''bold'''plain
73 * plain'''bold'''plain''italic''plain
74 * plain''italic'''bold-italic'''italic''plain
75 * plain'''bold''bold-italic''bold'''plain
76 * plain'''''bold-italic'''italic''plain
77 * plain'''''bold-italic''bold'''plain
78 * plain''italic'''bold-italic'''''plain
79 * plain'''bold''bold-italic'''''plain
80 * plain l'''italic''plain
83 </li><li> plain<i>italic</i>plain
84 </li><li> plain<i>italic</i>plain<i>italic</i>plain
85 </li><li> plain<b>bold</b>plain
86 </li><li> plain<b>bold</b>plain<b>bold</b>plain
87 </li><li> plain<i>italic</i>plain<b>bold</b>plain
88 </li><li> plain<b>bold</b>plain<i>italic</i>plain
89 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
90 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
91 </li><li> plain<i><b>bold-italic</b>italic</i>plain
92 </li><li> plain<b><i>bold-italic</i>bold</b>plain
93 </li><li> plain<i>italic<b>bold-italic</b></i>plain
94 </li><li> plain<b>bold<i>bold-italic</i></b>plain
95 </li><li> plain l'<i>italic</i>plain
101 ### <nowiki> test cases
105 <nowiki> unordered list
107 <nowiki>* This is not an unordered list item.</nowiki>
109 <p>* This is not an unordered list item.
116 <nowiki>Lorem ipsum dolor
137 :There is not nowiki.
138 :There is <nowiki>nowiki</nowiki>.
140 #There is not nowiki.
141 #There is <nowiki>nowiki</nowiki>.
143 *There is not nowiki.
144 *There is <nowiki>nowiki</nowiki>.
146 <dl><dd>There is not nowiki.
147 </dd><dd>There is nowiki.
149 <ol><li>There is not nowiki.
150 </li><li>There is nowiki.
152 <ul><li>There is not nowiki.
153 </li><li>There is nowiki.
164 <!-- comment 1 --> asdf
200 asdf<!-- comment 1 -->jkl
210 <!-- foo --> b <!-- bar -->
222 ### Preformatted text
231 And a [[Main Page|link]]
237 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
249 <dl><dt> name </dt><dd> Definition
259 <dl><dd> Indented text
265 Definition list with no space
269 <dl><dt>name</dt><dd>Definition
275 Definition list with URL link
277 ; http://example.com/ : definition
279 <dl><dt> <a href="http://example.com/" class='external free' title="http://example.com/" rel="nofollow">http://example.com/</a> </dt><dd> definition
285 Definition list with bracketed URL link
287 ;[http://www.google.com/ Google]:Number one search engine
289 <dl><dt><a href="http://www.google.com/" class='external text' title="http://www.google.com/" rel="nofollow">Google</a></dt><dd>Number one search engine
295 Definition list with wikilink containing colon
297 ; [[Help:FAQ]]: The least-read page on Wikipedia
299 <dl><dt> <a href="/index.php?title=Help:FAQ&action=edit" class="new" title="Help:FAQ">Help:FAQ</a></dt><dd> The least-read page on Wikipedia
304 # At Brion's and JeLuF's insistence... :)
306 Definition list with wikilink containing colon
308 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
310 <dl><dt> <a href="news:alt.wikipedia.rox" class='external free' title="news:alt.wikipedia.rox" rel="nofollow">news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
316 Malformed definition list with colon
318 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
320 <dl><dt> <a href="news:alt.wikipedia.rox" class='external free' title="news:alt.wikipedia.rox" rel="nofollow">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
326 Definition lists: colon in external link text
328 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
330 <dl><dt> <a href="http://www.wikipedia2.org/" class='external text' title="http://www.wikipedia2.org/" rel="nofollow">Wikipedia : The Next Generation</a></dt><dd> OK, I made that up
340 External links: non-bracketed
342 Non-bracketed: http://example.com
344 <p>Non-bracketed: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
349 External links: numbered
351 Numbered: [http://example.com]
352 Numbered: [http://example.net]
353 Numbered: [http://example.org]
355 <p>Numbered: <a href="http://example.com" class='external autonumber' title="http://example.com" rel="nofollow">[1]</a>
356 Numbered: <a href="http://example.net" class='external autonumber' title="http://example.net" rel="nofollow">[2]</a>
357 Numbered: <a href="http://example.org" class='external autonumber' title="http://example.org" rel="nofollow">[3]</a>
362 External links: specified text
364 Specified text: [http://example.com link]
366 <p>Specified text: <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow">link</a>
371 External links: trail
373 Linktrails should not work for external links: [http://example.com link]s
375 <p>Linktrails should not work for external links: <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow">link</a>s
380 External links: dollar sign in URL
382 http://example.com/1$2345
384 <p><a href="http://example.com/1$2345" class='external free' title="http://example.com/1$2345" rel="nofollow">http://example.com/1$2345</a>
389 External links: dollar sign in URL (named)
391 [http://example.com/1$2345]
393 <p><a href="http://example.com/1$2345" class='external autonumber' title="http://example.com/1$2345" rel="nofollow">[1]</a>
398 External links: open square bracket forbidden in URL (bug 4377)
400 http://example.com/1[2345
402 <p><a href="http://example.com/1" class='external free' title="http://example.com/1" rel="nofollow">http://example.com/1</a>[2345
407 External links: open square bracket forbidden in URL (named) (bug 4377)
409 [http://example.com/1[2345]
411 <p><a href="http://example.com/1" class='external text' title="http://example.com/1" rel="nofollow">[2345</a>
418 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
420 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
425 External image from https
427 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
429 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
434 Link to non-http image, no img tag
436 Link to non-http image, no img tag: ftp://example.com/test.jpg
438 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class='external free' title="ftp://example.com/test.jpg" rel="nofollow">ftp://example.com/test.jpg</a>
443 External links: terminating separator
445 Terminating separator: http://example.com/thing,
447 <p>Terminating separator: <a href="http://example.com/thing" class='external free' title="http://example.com/thing" rel="nofollow">http://example.com/thing</a>,
452 External links: intervening separator
454 Intervening separator: http://example.com/1,2,3
456 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external free' title="http://example.com/1,2,3" rel="nofollow">http://example.com/1,2,3</a>
461 External links: old bug with URL in query
463 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
465 <p>Old bug with URL in query: <a href="http://example.com/thing?url=http://example.com" class='external text' title="http://example.com/thing?url=http://example.com" rel="nofollow">link</a>
470 External links: old URL-in-URL bug, mixed protocols
472 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
474 <p>And again with mixed protocols: <a href="ftp://example.com?url=http://example.com" class='external text' title="ftp://example.com?url=http://example.com" rel="nofollow">link</a>
479 External links: URL in text
481 URL in text: [http://example.com http://example.com]
483 <p>URL in text: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
488 External links: Clickable images
490 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
492 <p>ja-style clickable images: <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
497 External links: raw ampersand
499 Old & use: http://x&y
501 <p>Old & use: <a href="http://x&y" class='external free' title="http://x&y" rel="nofollow">http://x&y</a>
506 External links: encoded ampersand
508 Old & use: http://x&y
510 <p>Old & use: <a href="http://x&y" class='external free' title="http://x&y" rel="nofollow">http://x&y</a>
515 External links: [raw ampersand]
517 Old & use: [http://x&y]
519 <p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
524 External links: [encoded ampersand]
526 Old & use: [http://x&y]
528 <p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
533 External links: www.jpeg.org (bug 554)
537 <p><a href="http://www.jpeg.org" class='external free' title="http://www.jpeg.org" rel="nofollow">http://www.jpeg.org</a>
542 External links: URL within URL (original bug 2)
544 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
546 <p><a href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class='external autonumber' title="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" rel="nofollow">[1]</a>
551 BUG 361: URL inside bracketed URL
553 [http://www.example.com/foo http://www.example.com/bar]
555 <p><a href="http://www.example.com/foo" class='external text' title="http://www.example.com/foo" rel="nofollow">http://www.example.com/bar</a>
560 BUG 361: URL within URL, not bracketed
562 http://www.example.com/foo?=http://www.example.com/bar
564 <p><a href="http://www.example.com/foo?=http://www.example.com/bar" class='external free' title="http://www.example.com/foo?=http://www.example.com/bar" rel="nofollow">http://www.example.com/foo?=http://www.example.com/bar</a>
569 BUG 289: ">"-token in URL-tail
571 http://www.example.com/<hello>
573 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a><hello>
578 BUG 289: literal ">"-token in URL-tail
580 http://www.example.com/<b>html</b>
582 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a><b>html</b>
587 BUG 289: ">"-token in bracketed URL
589 [http://www.example.com/<hello> stuff]
591 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow"><hello> stuff</a>
596 BUG 289: literal ">"-token in bracketed URL
598 [http://www.example.com/<b>html</b> stuff]
600 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow"><b>html</b> stuff</a>
605 BUG 289: literal double quote at end of URL
607 http://www.example.com/"hello"
609 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a>"hello"
614 BUG 289: literal double quote in bracketed URL
616 [http://www.example.com/"hello" stuff]
618 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow">"hello" stuff</a>
623 External links: invalid character
625 [http://www.example.com
\0 test]
627 <p>[<a href="http://www.example.com" class='external free' title="http://www.example.com" rel="nofollow">http://www.example.com</a>
\0 test]
632 BUG 787: Links with one slash after the url protocol are invalid
636 [http:/example.com title]
639 </p><p>[http:/example.com title]
644 Bug 2702: Mismatched <i> and <a> tags are invalid
646 ''[http://example.com text'']
648 <p><i><a href="http://example.com" class='external text' title="http://example.com" rel="nofollow">text</a></i>
659 Normal text. '''Bold text.''' Normal text. ''Italic text.''
661 Normal text. '''''Bold italic text.''''' Normal text.
663 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
664 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
670 Unclosed and unmatched quotes
672 '''''Bold italic text '''with bold deactivated''' in between.'''''
674 '''''Bold italic text ''with italic deactivated'' in between.'''''
678 ..spanning two paragraphs (should not work).'''
680 '''Bold tag left open
682 ''Italic tag left open
686 <!-- Unmatching number of opening, closing tags: -->
687 '''This year''''s election ''should'' beat '''last year''''s.
689 ''Tom'''s car is bigger than ''Susan'''s.
691 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
692 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
693 </p><p><b>Bold text..</b>
694 </p><p>..spanning two paragraphs (should not work).<b></b>
695 </p><p><b>Bold tag left open</b>
696 </p><p><i>Italic tag left open</i>
698 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
699 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
706 ### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
709 # This should not produce <table></table> as <table><tr><td></td></tr></table>
710 # is the bare minimun required by the spec, see:
711 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
713 A table with no data.
719 # A table with nothing but a caption is invalid XHTML, we might want to render
720 # this as <p>caption</p>
722 A table with nothing but a caption
758 {| border="1" cellpadding="2"
759 |+Multiplication table
761 ! × !! 1 !! 2 !! 3
779 <table border="1" cellpadding="2">
780 <caption>Multiplication table
783 <th> × </th><th> 1 </th><th> 2 </th><th> 3
787 </th><td> 1 </td><td> 2 </td><td> 3
791 </th><td> 2 </td><td> 4 </td><td> 6
795 </th><td> 3 </td><td> 6 </td><td> 9
799 </th><td> 4 </td><td> 8 </td><td> 12
803 </th><td> 5 </td><td> 10 </td><td> 15
811 {| align=right border=1
813 |rowspan=2| Cell 2, row 1 (and 2)
820 <table align="right" border="1">
823 </td><td rowspan="2"> Cell 2, row 1 (and 2)
824 </td><td> Cell 3, row 1
828 </td><td> Cell 3, row 2
839 {| bgcolor=#ABCDEF border=2
844 |the original table again
851 <table bgcolor="#ABCDEF" border="2">
858 </td><td>the original table again
864 Invalid attributes in table cell (bug 1830)
882 Plain link, capitalized
886 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
891 Plain link, uncapitalized
895 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
902 [[Main Page|The Main Page]]
904 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
913 <p><a href="/index.php?title=Zigzagzogzagzig&action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
920 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
922 <p>xxx<a href="/wiki/Main_Page" title="Main Page">main Page</a>, xxx<a href="/wiki/Main_Page" title="Main Page">Main Page</a>, Xxx<a href="/wiki/Main_Page" title="Main Page">main Page</a> XXX<a href="/wiki/Main_Page" title="Main Page">main Page</a>, XXX<a href="/wiki/Main_Page" title="Main Page">Main Page</a>
929 [[Main Page]]xxx, [[Main Page]]XXX
931 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
945 Piped link with 3 brackets
947 [[[main page|the main page]]]
949 <p>[[[main page|the main page]]]
954 Link with multiple pipes
956 [[Main Page|The|Main|Page]]
958 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
965 [[Talk:Parser testing]], [[Meta:Disclaimers]]
967 <p><a href="/index.php?title=Talk:Parser_testing&action=edit" class="new" title="Talk:Parser testing">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&action=edit" class="new" title="Meta:Disclaimers">Meta:Disclaimers</a>
972 Piped link to namespace
974 [[Meta:Disclaimers|The disclaimers]]
976 <p><a href="/index.php?title=Meta:Disclaimers&action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
983 [[Usually caused by a typo (oops}]]
985 <p>[[Usually caused by a typo (oops}]]
990 Link containing % (not as a hex sequence)
994 <p><a href="/index.php?title=7%25_Solution&action=edit" class="new" title="7% Solution">7% Solution</a>
999 Link containing % as a single hex sequence interpreted to char
1003 <p><a href="/index.php?title=7%25_Solution&action=edit" class="new" title="7% Solution">7% Solution</a>
1008 Link containing % as a double hex sequence interpreted to hex sequence
1012 <p>[[7%2525 Solution]]
1019 [[http://www.example.org]]
1021 <p>[<a href="http://www.example.org" class='external autonumber' title="http://www.example.org" rel="nofollow">[1]</a>]
1025 # I'm fairly sure the expected result here is wrong.
1026 # We want these to be URL links, not pseudo-pages with URLs for titles....
1027 # However the current output is also pretty screwy.
1030 # I'm changing it to match the current output--it arguably makes more
1031 # sense in the light of the test above. Old expected result was:
1032 #<p>Piped link to URL: <a href="/index.php?title=Http://www.example.org&action=edit" class="new" title="Http://www.example.org">an example URL</a>
1034 # But I think this test is bordering on "garbage in, garbage out" anyway.
1039 Piped link to URL: [[http://www.example.org|an example URL]]
1041 <p>Piped link to URL: [<a href="http://www.example.org|an" class='external text' title="http://www.example.org|an" rel="nofollow">example URL</a>]
1046 BUG 2: [[page|http://url/]] should link to page, not http://url/
1048 [[Main Page|http://url/]]
1050 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
1055 BUG 337: Escaped self-links should be bold
1059 [[Bug462]] [[Bug462]]
1061 <p><strong>Bug462</strong> <strong>Bug462</strong>
1066 Self-link to section should not be bold
1070 [[Main Page#section]]
1072 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
1077 <nowiki> inside a link
1079 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
1081 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
1086 ### Interwiki links (see maintenance/interwiki.sql)
1090 Inline interwiki link
1092 [[MeatBall:SoftSecurity]]
1094 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class='extiw' title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
1099 Inline interwiki link with empty title (bug 2372)
1103 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class='extiw' title="meatball:">MeatBall:</a>
1108 Interwiki link encoding conversion (bug 1636)
1110 *[[Wikipedia:ro:Olteniţa]]
1111 *[[Wikipedia:ro:Olteniţa]]
1113 <ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class='extiw' title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a>
1114 </li><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class='extiw' title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a>
1120 Interwiki link with fragment (bug 2130)
1122 [[MeatBall:SoftSecurity#foo]]
1124 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class='extiw' title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
1142 Incorrecly removing closing slashes from correctly formed XHTML
1144 <br style="clear:both;" />
1146 <p><br style="clear:both;" />
1151 Failing to transform badly formed HTML into correct XHTML
1157 <p><br style="clear:left;" />
1158 <br style="clear:right;" />
1159 <br style="clear:both;" />
1164 Horizontal ruler (should it add that extra space?)
1177 ### Block-level elements
1200 <ol><li>Numbered list
1217 ***#Number on level 4
1219 **#Number on level 3
1220 **#Number on level 3
1225 <ol><li> with numbers
1227 <ul><li> and bullets
1229 <ol><li> and numbers
1231 </li><li>bullets again
1232 <ul><li>bullet level 2
1233 <ul><li>bullet level 3
1234 <ol><li>Number on level 4
1237 </li><li>bullet level 2
1238 <ol><li>Number on level 3
1239 </li><li>Number on level 3
1242 <ol><li>number level 2
1250 List items are not parsed correctly following a <pre> block (bug 785)
1256 <ul><li> <pre>foo</pre>
1257 </li><li> <pre>bar</pre>
1279 Magic links: internal link to RFC (bug 479)
1283 <p><a href="/index.php?title=RFC_123&action=edit" class="new" title="RFC 123">RFC 123</a>
1288 Magic links: RFC (bug 479)
1292 <p><a href='http://www.ietf.org/rfc/rfc822.txt' class='external' title="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>
1297 Magic links: ISBN (bug 1937)
1301 <p><a href="/index.php?title=Special:Booksources&isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1306 Magic links: PMID incorrectly converts space to underscore
1310 <p><a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=1234' class='external' title="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=1234">PMID 1234</a>
1319 Nonexistant template
1321 {{thistemplatedoesnotexist}}
1323 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1330 This is a test template
1338 <p>This is a test template
1343 Template with explicit namespace
1347 <p>This is a test template
1355 This is a test template with parameter {{{param}}}
1361 {{paramtest|param=foo}}
1363 <p>This is a test template with parameter foo
1368 Template:paramtestnum
1374 Template unnamed parameter
1376 {{paramtestnum|Main Page|the main page}}
1378 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
1383 Template:templatesimple
1389 Template:templateredirect
1391 #redirect [[Template:templatesimple]]
1395 Template:templateasargtestnum
1401 Template:templateasargtest
1403 {{template{{{templ}}}}}
1407 Template:templateasargtest2
1413 Template with template name as unnamed argument
1415 {{templateasargtestnum|templatesimple}}
1422 Template with template name as argument
1424 {{templateasargtest|templ=simple}}
1431 Template with template name as argument (2)
1433 {{templateasargtest2|templ=templatesimple}}
1440 Template:templateasargtestdefault
1442 {{{{{templ|templatesimple}}}}}
1452 Template with default value
1454 {{templateasargtestdefault}}
1461 Template with default value (value set)
1463 {{templateasargtestdefault|templ=templa}}
1472 {{templateredirect}}
1479 Template with argument in separate line
1481 {{ templateasargtest |
1489 Template with complex template as argument
1492 param ={{ templateasargtest |
1495 <p>This is a test template with parameter (test)
1500 Template with thumb image (wiht link in description)
1503 param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
1505 This is a test template with parameter <div class="thumb tright"><div style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Noimage.png" class="new" title="Image:Noimage.png">Image:Noimage.png</a> <div class="thumbcaption" ><a href="/index.php?title=No_link&action=edit" class="new" title="No link">link</a> <a href="/index.php?title=No_link&action=edit" class="new" title="No link">caption</a></div></div></div>
1510 Template:complextemplate
1512 {{{1}}} {{paramtest|
1513 param ={{{param}}}}}
1517 Template with complex arguments
1520 param ={{ templateasargtest |
1521 templ = simple }}|[[Template:complextemplate|link]]}}
1523 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
1528 BUG 553: link with two variables in a piped link
1531 |[[{{{1}}}|{{{2}}}]]
1536 <td>[[{{{1}}}|{{{2}}}]]
1542 Magic variable as template parameter
1544 {{paramtest|param={{SITENAME}}}}
1546 <p>This is a test template with parameter MediaWiki
1553 [[{{{param}}}|link]]
1557 Template parameter as link source
1559 {{linktest|param=Main Page}}
1561 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
1569 including another template, {{paramtest|param={{{arg}}}}}
1573 Template passing argument to another template
1575 {{paramtest2|arg='hmm'}}
1577 <p>including another template, This is a test template with parameter 'hmm'
1588 Template as link source
1592 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1610 Template infinite loop
1614 <p>{{loop1}}<!-- WARNING: template loop detected -->
1619 Template from main namespace
1638 BUG 529: Template with table, not included at beginning of line
1655 BUG 523: Template shouldn't eat newline (or add an extra one before table)
1673 BUG 41: Template parameters shown as broken links
1685 ''None'' of '''this''' should be
1687 but rather passed unmodified
1691 # hmm, fix this or just deprecate msgnw and document its behavior?
1697 {{msgnw:MSGNW test}}
1699 <p>''None'' of '''this''' should be
1701 but rather passed unmodified
1709 {{int:newmessages|lots of money}}
1711 <p>You have lots of money.
1718 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
1722 <includeonly> and <noinclude> being included
1733 <onlyinclude>Foo</onlyinclude>bar
1737 <onlyinclude> being included
1749 <onlyinclude>Foo</onlyinclude>bar<includeonly>zar</includeonly>
1753 <onlyinclude> and <includeonly> being included
1762 <includeonly> and <noinclude> on a page
1764 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
1771 <onlyinclude> on a page
1773 <onlyinclude>Foo</onlyinclude>bar
1780 ### Pre-save transform tests
1783 pre-save transform: subst:
1789 This is a test template
1793 pre-save transform: normal template
1803 pre-save transform: nonexistant template
1807 {{thistemplatedoesnotexist}}
1809 {{thistemplatedoesnotexist}}
1814 pre-save transform: subst magic variables
1823 # This is bug 89, which I fixed. -- wtm
1825 pre-save transform: subst: templates with parameters
1829 {{subst:paramtest|param="something else"}}
1831 This is a test template with parameter "something else"
1838 <nowiki>'''not wiki'''</nowiki>
1842 pre-save transform: nowiki in subst (bug 1188)
1846 {{subst:nowikitest}}
1848 <nowiki>'''not wiki'''</nowiki>
1853 Template:commenttest
1855 This template has <!-- a comment --> in it.
1859 pre-save transform: comment in subst (bug 1936)
1863 {{subst:commenttest}}
1865 This template has <!-- a comment --> in it.
1872 <span onmouseover="alert('crap')">Oh no</span>
1876 (confirming safety of fix for subst bug 1936)
1878 {{Template:dangerous}}
1880 <p><span>Oh no</span>
1886 ### Message transform tests
1889 message transform: magic variables
1899 message transform: should not transform wiki markup
1914 [[Image:foobar.jpg]]
1916 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
1923 [[Image:foobar.jpg|right]]
1925 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
1932 [[Image:foobar.jpg|right|Caption text]]
1934 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title="Caption text"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Caption text" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
1939 Image with frame and link
1941 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
1943 <div class="thumb tleft"><div style="width:1943px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is a test image Main Page"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="This is a test image Main Page" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" >This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
1952 <p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
1957 Frameless image caption with a free URL
1959 [[Image:foobar.jpg|http://example.com]]
1961 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="http://example.com" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
1966 Thumbnail image caption with a free URL
1968 [[Image:foobar.jpg|thumb|http://example.com]]
1970 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="http://example.com"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="http://example.com" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" ><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div><a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
1975 BUG 1887: A ISBN with a thumbnail
1977 [[Image:foobar.jpg|thumb|ISBN 12354]]
1979 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="ISBN 12354"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="ISBN 12354" longdesc="/wiki/Image:Foobar.jpg" height="180" width="180"></a> <div class="thumbcaption"><div class="magnify" style="float:right;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge"></a></div><a href="index.php?title=Special:Booksources&isbn=12354" class="internal">ISBN 12354</a></div></div></div>
1983 BUG 1887: A <math> with a thumbnail
1985 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
1987 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="2+2"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="2+2" longdesc="/wiki/Image:Foobar.jpg" height="180" width="180"></a> <div class="thumbcaption"><div class="magnify" style="float:right;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge"></a></div><math>2+2<math></div></div></div>
1990 # Pending resolution to bug 368
1992 BUG 648: Frameless image caption with a link
1994 [[Image:foobar.jpg|text with a [[link]] in it]]
1996 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2001 BUG 648: Frameless image caption with a link (suffix)
2003 [[Image:foobar.jpg|text with a [[link]]foo in it]]
2005 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a linkfoo in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a linkfoo in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2010 BUG 648: Frameless image caption with an interwiki link
2012 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
2014 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a MeatBall:Link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2019 BUG 648: Frameless image caption with a piped interwiki link
2021 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
2023 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2028 Escape HTML special chars in image alt text
2030 [[Image:foobar.jpg|& < > "]]
2032 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="& < > ""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="& < > "" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2037 BUG 499: Alt text should have Ӓ, not &1234;
2039 [[Image:foobar.jpg|♀]]
2041 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="♀"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="♀" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2046 Broken image caption with link
2048 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
2050 <p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
2055 Image caption containing another image
2057 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
2059 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is a caption with another Image:Icon.png inside it!"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="This is a caption with another Image:Icon.png inside it!" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" ><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This is a caption with another <a href="/index.php?title=Special:Upload&wpDestFile=Icon.png" class="new" title="Image:Icon.png">Image:Icon.png</a> inside it!</div></div></div>
2064 Image caption containing a newline
2066 [[Image:Foobar.jpg|This
2069 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="This *is some text"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="This *is some text" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2075 Bug 3090: External links other than http: in image captions
2077 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
2079 <div class="thumb tright"><div style="width:202px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This caption has irc and Secure ext links in it."><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" alt="This caption has irc and Secure ext links in it." width="200" height="23" longdesc="/wiki/Image:Foobar.jpg" /></a> <div class="thumbcaption" ><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This caption has <a href="irc://example.net" class='external text' title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class='external text' title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div>
2088 Subpage test/subpage
2096 subpage title=[[Subpage test]]
2100 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
2105 Subpage noslash link
2107 subpage title=[[Subpage test]]
2111 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
2120 <p><a href="/index.php?title=/subpage&action=edit" class="new" title="/subpage">/subpage</a>
2125 BUG 561: {{/Subpage}}
2127 subpage title=[[Page]]
2131 <p><a href="/index.php?title=Page/Subpage&action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
2139 Category:MediaWiki User's Guide
2147 [[:Category:MediaWiki User's Guide]]
2149 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
2158 [[Category: MediaWiki User's Guide]]
2160 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
2164 ### Inter-language links
2167 Inter-language links
2173 [[zh:食品]]
2175 es:Alimento fr:Nourriture zh:食品
2182 Basic section headings
2184 title=[[Parser test script]]
2191 ===Smaller headline===
2194 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
2197 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Parser test script">edit</a>]</div><a name="Headline_2"></a><h2>Headline 2</h2>
2200 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=3" title="Parser test script">edit</a>]</div><a name="Smaller_headline"></a><h3>Smaller headline</h3>
2206 Section headings with TOC
2208 title=[[Parser test script]]
2211 === Subheadline 1 ===
2212 ===== Skipping a level =====
2213 ====== Skipping a level ======
2217 ===Another headline===
2219 <table id='toc' class='toc'><tr><td><div id='toctitle'><h2>Contents</h2></div>
2221 <li class='toclevel-1'><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
2223 <li class='toclevel-2'><a href="#Subheadline_1"><span class="tocnumber">1.1</span> <span class="toctext">Subheadline 1</span></a>
2225 <li class='toclevel-3'><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
2227 <li class='toclevel-4'><a href="#Skipping_a_level_2"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Skipping a level</span></a></li>
2234 <li class='toclevel-1'><a href="#Headline_2"><span class="tocnumber">2</span> <span class="toctext">Headline 2</span></a>
2236 <li class='toclevel-2'><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
2241 <script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
2242 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
2243 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Parser test script">edit</a>]</div><a name="Subheadline_1"></a><h3> Subheadline 1 </h3>
2244 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=3" title="Parser test script">edit</a>]</div><a name="Skipping_a_level"></a><h5> Skipping a level </h5>
2245 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=4" title="Parser test script">edit</a>]</div><a name="Skipping_a_level_2"></a><h6> Skipping a level </h6>
2246 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=5" title="Parser test script">edit</a>]</div><a name="Headline_2"></a><h2> Headline 2 </h2>
2249 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=6" title="Parser test script">edit</a>]</div><a name="Another_headline"></a><h3>Another headline</h3>
2253 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
2255 Handling of sections up to level 6 and beyond
2258 == Level 2 Heading==
2259 === Level 3 Heading===
2260 ==== Level 4 Heading====
2261 ===== Level 5 Heading=====
2262 ====== Level 6 Heading======
2263 ======= Level 7 Heading=======
2264 ======== Level 8 Heading========
2265 ========= Level 9 Heading=========
2266 ========== Level 10 Heading==========
2268 <table id='toc' class='toc'><tr><td><div id='toctitle'><h2>Contents</h2></div>
2270 <li class='toclevel-1'><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
2272 <li class='toclevel-2'><a href="#Level_2_Heading"><span class="tocnumber">1.1</span> <span class="toctext">Level 2 Heading</span></a>
2274 <li class='toclevel-3'><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
2276 <li class='toclevel-4'><a href="#Level_4_Heading"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Level 4 Heading</span></a>
2278 <li class='toclevel-5'><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
2280 <li class='toclevel-6'><a href="#Level_6_Heading"><span class="tocnumber">1.1.1.1.1.1</span> <span class="toctext">Level 6 Heading</span></a></li>
2281 <li class='toclevel-6'><a href="#.3D_Level_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">= Level 7 Heading=</span></a></li>
2282 <li class='toclevel-6'><a href="#.3D.3D_Level_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">== Level 8 Heading==</span></a></li>
2283 <li class='toclevel-6'><a href="#.3D.3D.3D_Level_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">=== Level 9 Heading===</span></a></li>
2284 <li class='toclevel-6'><a href="#.3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">==== Level 10 Heading====</span></a></li>
2297 <p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
2299 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Parser test">edit</a>]</div><a name="Level_1_Heading"></a><h1> Level 1 Heading</h1>
2300 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Parser test">edit</a>]</div><a name="Level_2_Heading"></a><h2> Level 2 Heading</h2>
2301 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=3" title="Parser test">edit</a>]</div><a name="Level_3_Heading"></a><h3> Level 3 Heading</h3>
2302 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=4" title="Parser test">edit</a>]</div><a name="Level_4_Heading"></a><h4> Level 4 Heading</h4>
2303 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=5" title="Parser test">edit</a>]</div><a name="Level_5_Heading"></a><h5> Level 5 Heading</h5>
2304 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=6" title="Parser test">edit</a>]</div><a name="Level_6_Heading"></a><h6> Level 6 Heading</h6>
2305 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=7" title="Parser test">edit</a>]</div><a name=".3D_Level_7_Heading.3D"></a><h6>= Level 7 Heading=</h6>
2306 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=8" title="Parser test">edit</a>]</div><a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6>== Level 8 Heading==</h6>
2307 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=9" title="Parser test">edit</a>]</div><a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6>=== Level 9 Heading===</h6>
2308 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&action=edit&section=10" title="Parser test">edit</a>]</div><a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6>==== Level 10 Heading====</h6>
2313 Resolving duplicate section names
2315 title=[[Parser test script]]
2320 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Foo_bar"></a><h2> Foo bar </h2>
2321 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Parser test script">edit</a>]</div><a name="Foo_bar_2"></a><h2> Foo bar </h2>
2333 Template with sections, __NOTOC__
2335 title=[[Parser test script]]
2342 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
2343 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&action=edit&section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
2344 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&action=edit&section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
2345 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Parser test script">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
2350 __NOEDITSECTION__ keyword
2356 <a name="Section_1"></a><h2>Section 1</h2>
2357 <a name="Section_2"></a><h2>Section 2</h2>
2362 Link inside a section heading
2364 title=[[Parser test script]]
2366 ==Section with a [[Main Page|link]] in it==
2368 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Section_with_a_link_in_it"></a><h2>Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</h2>
2374 BUG 1219 URL next to image (good)
2376 http://example.com [[Image:foobar.jpg]]
2378 <p><a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a> <a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2383 BUG 1219 URL next to image (broken)
2385 http://example.com[[Image:foobar.jpg]]
2387 <p><a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a><a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2392 Bug 1186 news: in the middle of text
2394 http://en.wikinews.org/wiki/Wikinews:Workplace
2396 <p><a href="http://en.wikinews.org/wiki/Wikinews:Workplace" class='external free' title="http://en.wikinews.org/wiki/Wikinews:Workplace" rel="nofollow">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
2402 Namespaced link must have a title
2411 Namespaced link must have a title (bad fragment version)
2413 [[Project:#fragment]]
2415 <p>[[Project:#fragment]]
2421 div with no attributes
2423 <div>HTML rocks</div>
2425 <div>HTML rocks</div>
2430 div with double-quoted attribute
2432 <div id="rock">HTML rocks</div>
2434 <div id="rock">HTML rocks</div>
2439 div with single-quoted attribute
2441 <div id='rock'>HTML rocks</div>
2443 <div id="rock">HTML rocks</div>
2448 div with unquoted attribute
2450 <div id=rock>HTML rocks</div>
2452 <div id="rock">HTML rocks</div>
2457 div with illegal double attributes
2459 <div align="center" align="right">HTML rocks</div>
2461 <div align="right">HTML rocks</div>
2466 HTML multiple attributes correction
2468 <p class="error" class="awesome">Awesome!</p>
2470 <p class="awesome">Awesome!</p>
2475 Table multiple attributes correction
2478 !+ class="error" class="awesome"| status
2483 <th class="awesome"> status
2491 <DIV ALIGN="center">HTML ROCKS</DIV>
2493 <div align="center">HTML ROCKS</div>
2499 text with amp in the middle of nowhere
2503 <p>Remember AT&T?
2508 text with character entity: eacute
2510 I always thought é was a cute letter.
2512 <p>I always thought é was a cute letter.
2517 text with undefined character entity: xacute
2519 I always thought &xacute; was a cute letter.
2521 <p>I always thought &xacute; was a cute letter.
2533 [[Media:Foobar.jpg]]
2535 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class='internal' title="Foobar.jpg">Media:Foobar.jpg</a>
2540 Media link with text
2542 [[Media:Foobar.jpg|A neat file to look at]]
2544 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class='internal' title="Foobar.jpg">A neat file to look at</a>
2548 # FIXME: this is still bad HTML tag nesting
2550 Media link with nasty text
2552 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
2554 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class='internal' title="Foobar.jpg">Safe Link<div style="display:none">" onmouseover="alert(document.cookie) onfoo="</div></a>
2559 Media link to nonexistent file (bug 1702)
2561 [[Media:No such.jpg]]
2563 <p><a href="/index.php?title=Special:Upload&wpDestFile=No_such.jpg" class='new' title="No such.jpg">Media:No such.jpg</a>
2568 Image link to nonexistent file (bug 1850 - good)
2570 [[Image:No such.jpg]]
2572 <p><a href="/index.php?title=Special:Upload&wpDestFile=No_such.jpg" class="new" title="Image:No such.jpg">Image:No such.jpg</a>
2577 :Image link to nonexistent file (bug 1850 - bad)
2579 [[:Image:No such.jpg]]
2581 <p><a href="/index.php?title=Image:No_such.jpg&action=edit" class="new" title="Image:No such.jpg">Image:No such.jpg</a>
2588 Character reference normalization in link text (bug 1938)
2590 [[Main Page|this&that]]
2592 <p><a href="/wiki/Main_Page" title="Main Page">this&that</a>
2597 Empty attribute crash test (bug 2067)
2599 <font color="">foo</font>
2601 <p><font color="">foo</font>
2606 Empty attribute crash test single-quotes (bug 2067)
2608 <font color=''>foo</font>
2610 <p><font color="">foo</font>
2615 Attribute test: equals, then nothing
2617 <font color=>foo</font>
2624 Attribute test: unquoted value
2626 <font color=x>foo</font>
2628 <p><font color="x">foo</font>
2633 Attribute test: unquoted but illegal value (hash)
2635 <font color=#x>foo</font>
2637 <p><font color="#x">foo</font>
2642 Attribute test: no value
2644 <font color>foo</font>
2646 <p><font color="color">foo</font>
2651 Bug 2095: link with three closing brackets
2655 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
2660 Bug 2095: link with pipe and three closing brackets
2664 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
2674 Template:Dangerous attribute
2676 " onmouseover="alert(document.cookie)
2680 Template:Dangerous style attribute
2682 border-size: expression(alert(document.cookie))
2688 <div style="float: right; {{{1}}}">Magic div</div>
2692 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
2694 <div title="{{test}}"></div>
2696 <div title="This is a test template"></div>
2701 Bug 2304: HTML attribute safety (dangerous template; 2309)
2703 <div title="{{dangerous attribute}}"></div>
2705 <div title=""></div>
2710 Bug 2304: HTML attribute safety (dangerous style template; 2309)
2712 <div style="{{dangerous style attribute}}"></div>
2719 Bug 2304: HTML attribute safety (safe parameter; 2309)
2721 {{div style|width: 200px}}
2723 <div style="float: right; width: 200px">Magic div</div>
2728 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
2730 {{div style|width: expression(alert(document.cookie))}}
2732 <div>Magic div</div>
2737 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
2739 {{div style|"><script>alert(document.cookie)</script>}}
2741 <div>Magic div</div>
2746 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
2748 {{div style|" ><script>alert(document.cookie)</script>}}
2750 <div style="float: right; ">Magic div</div>
2755 Bug 2304: HTML attribute safety (link)
2757 <div title="[[Main Page]]"></div>
2759 <div title="[[Main Page]]"></div>
2764 Bug 2304: HTML attribute safety (italics)
2766 <div title="''foobar''"></div>
2768 <div title="''foobar''"></div>
2773 Bug 2304: HTML attribute safety (bold)
2775 <div title="'''foobar'''"></div>
2777 <div title="'''foobar'''"></div>
2782 Bug 2304: HTML attribute safety (ISBN)
2784 <div title="ISBN 1234567890"></div>
2786 <div title="ISBN 1234567890"></div>
2791 Bug 2304: HTML attribute safety (RFC)
2793 <div title="RFC 1234"></div>
2795 <div title="RFC 1234"></div>
2800 Bug 2304: HTML attribute safety (PMID)
2802 <div title="PMID 1234567890"></div>
2804 <div title="PMID 1234567890"></div>
2809 Bug 2304: HTML attribute safety (web link)
2811 <div title="http://example.com/"></div>
2813 <div title="http://example.com/"></div>
2818 Bug 2304: HTML attribute safety (named web link)
2820 <div title="[http://example.com/ link]"></div>
2822 <div title="[http://example.com/ link]"></div>
2827 Bug 3244: HTML attribute safety (extension; safe)
2829 <div style="<nowiki>background:blue</nowiki>"></div>
2831 <div style="background:blue"></div>
2836 Bug 3244: HTML attribute safety (extension; unsafe)
2838 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
2846 Math section safety when disabled
2848 <math><script>alert(document.cookies);</script></math>
2850 <p><math><script>alert(document.cookies);</script></math>
2856 Table attribute legitimate extension
2859 !+ style="<nowiki>color:blue</nowiki>"| status
2864 <th style="color:blue"> status
2870 Table attribute safety
2873 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
2887 Parser hook: empty input
2894 Parser hook: basic input
2903 Parser hook: case insensetive
2912 Parser hook: basic arguments
2914 <tag width=200 height = "100" depth = '50' square></tag>
2929 Parser hook: empty input using terminated empty elements (bug 2374)
2942 # </tag> should be output literally since there is no matching tag that begins it
2944 Parser hook: basic arguments using terminated empty elements (bug 2374)
2946 <tag width=200 height = "100" depth = '50' square/>
2965 # Nested template calls; this case was broken by Parser.php rev 1.506,
2969 Template:One-parameter
2971 (My parameter is: {{{1}}})
2975 Template:Map-one-parameter
2981 Nested template calls
2983 {{Map-one-parameter|One-parameter|param}}
2985 <p>(My parameter is: param)
2990 # More MSIE fun discovered by Tom Gilder
2993 MSIE CSS safety test: spurious slash
2995 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
3002 MSIE CSS safety test: hex code
3004 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
3011 MSIE CSS safety test: comment in url
3013 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
3015 <div style="background-image:u rl(javascript:alert('boo'))">evil</div>
3020 MSIE CSS safety test: comment in expression
3022 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
3024 <div style="background-image:expres sion(alert('boo4'))">evil4</div>