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
6 # The syntax should be fairly self-explanatory.
8 # Currently supported test options:
9 # One of the following three:
11 # (default) generate HTML output
12 # pst apply pre-save transform
13 # msg apply message transform
15 # Plus any combination of these:
17 # cat add category links
18 # ill add inter-language links
19 # subpage enable subpages (disabled by default)
20 # title=[[XXX]] run test using article title XXX
21 # disabled do not run test
23 # For testing purposes, temporary articles can created:
24 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
25 # where '/' denotes a newline.
27 # This is the standard article assumed to exist.
47 This is a simple paragraph.
49 <p>This is a simple paragraph.
69 * plain''italic''plain
70 * plain''italic''plain''italic''plain
71 * plain'''bold'''plain
72 * plain'''bold'''plain'''bold'''plain
73 * plain''italic''plain'''bold'''plain
74 * plain'''bold'''plain''italic''plain
75 * plain''italic'''bold-italic'''italic''plain
76 * plain'''bold''bold-italic''bold'''plain
77 * plain'''''bold-italic'''italic''plain
78 * plain'''''bold-italic''bold'''plain
79 * plain''italic'''bold-italic'''''plain
80 * plain'''bold''bold-italic'''''plain
81 * plain l'''italic''plain
84 </li><li> plain<i>italic</i>plain
85 </li><li> plain<i>italic</i>plain<i>italic</i>plain
86 </li><li> plain<b>bold</b>plain
87 </li><li> plain<b>bold</b>plain<b>bold</b>plain
88 </li><li> plain<i>italic</i>plain<b>bold</b>plain
89 </li><li> plain<b>bold</b>plain<i>italic</i>plain
90 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
91 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
92 </li><li> plain<i><b>bold-italic</b>italic</i>plain
93 </li><li> plain<b><i>bold-italic</i>bold</b>plain
94 </li><li> plain<i>italic<b>bold-italic</b></i>plain
95 </li><li> plain<b>bold<i>bold-italic</i></b>plain
96 </li><li> plain l'<i>italic</i>plain
102 ### <nowiki> test cases
106 <nowiki> unordered list
108 <nowiki>* This is not an unordered list item.</nowiki>
110 <p>* This is not an unordered list item.
117 <nowiki>Lorem ipsum dolor
138 :There is not nowiki.
139 :There is <nowiki>nowiki</nowiki>.
141 #There is not nowiki.
142 #There is <nowiki>nowiki</nowiki>.
144 *There is not nowiki.
145 *There is <nowiki>nowiki</nowiki>.
147 <dl><dd>There is not nowiki.
148 </dd><dd>There is nowiki.
150 <ol><li>There is not nowiki.
151 </li><li>There is nowiki.
153 <ul><li>There is not nowiki.
154 </li><li>There is nowiki.
160 ### comment test cases
165 <!-- comment 1 --> asdf
201 asdf<!-- comment 1 -->jkl
211 <!-- foo --> b <!-- bar -->
223 ### Preformatted text
232 And a [[Main Page|link]]
238 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
250 <dl><dt> name </dt><dd> Definition
260 <dl><dd> Indented text
266 Definition list with no space
270 <dl><dt>name</dt><dd>Definition
276 Definition list with URL link
278 ; http://example.com/ : definition
280 <dl><dt> <a href="http://example.com/" class='external'>http://example.com/</a> </dt><dd> definition
286 Definition list with bracketed URL link
288 ;[http://www.google.com/ Google]:Number one search engine
290 <dl><dt><a href="http://www.google.com/" class='external' title="http://www.google.com/">Google</a><span class='urlexpansion'> (<i>http://www.google.com/</i>)</span></dt><dd>Number one search engine
296 Definition list with wikilink containing colon
298 ; [[Wikipedia:FAQ]]: The least-read page on Wikipedia
300 <dl><dt> <a href="http://en.wikipedia.org/wiki/FAQ" class='extiw'>Wikipedia:FAQ</a></dt><dd> The least-read page on Wikipedia
305 # At Brion's and JeLuF's insistence... :)
307 Definition list with wikilink containing colon
309 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
311 <dl><dt> <a href="news:alt.wikipedia.rox" class='external'>news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
317 Malformed definition list with colon
319 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
321 <dl><dt> <a href="news:alt.wikipedia.rox" class='external'>news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
327 Definition lists: colon in external link text
329 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
331 <dl><dt> <a href="http://www.wikipedia2.org/" class='external' title="http://www.wikipedia2.org/">Wikipedia : The Next Generation</a><span class='urlexpansion'> (<i>http://www.wikipedia2.org/</i>)</span></dt><dd> OK, I made that up
341 External links: non-bracketed
343 Non-bracketed: http://example.com
345 <p>Non-bracketed: <a href="http://example.com" class='external'>http://example.com</a>
350 External links: numbered
352 Numbered: [http://example.com]
354 <p>Numbered: <a href="http://example.com" class='external' title="http://example.com">[1]</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
359 External links: specified text
361 Specified text: [http://example.com link]
363 <p>Specified text: <a href="http://example.com" class='external' title="http://example.com">link</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
368 External links: trail
370 Trail (not sure if this is meant to work): [http://example.com link]s
372 <p>Trail (not sure if this is meant to work): <a href="http://example.com" class='external' title="http://example.com">link</a>s<span class='urlexpansion'> (<i>http://example.com</i>)</span>
377 External links: dollar sign in URL
379 http://example.com/1$2345
381 <p><a href="http://example.com/1$2345" class='external'>http://example.com/1$2345</a>
386 External links: dollar sign in URL (named)
388 [http://example.com/1$2345]
390 <p><a href="http://example.com/1$2345" class='external' title="http://example.com/1$2345">[1]</a><span class='urlexpansion'> (<i>http://example.com/1$2345</i>)</span>
397 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
399 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
404 External image from https
406 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
408 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
413 Link to non-http image, no img tag
415 Link to non-http image, no img tag: ftp://example.com/test.jpg
417 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class='external'>ftp://example.com/test.jpg</a>
422 External links: terminating separator
424 Terminating separator: http://example.com/thing,
426 <p>Terminating separator: <a href="http://example.com/thing" class='external'>http://example.com/thing</a>,
431 External links: intervening separator
433 Intervening separator: http://example.com/1,2,3
435 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external'>http://example.com/1,2,3</a>
440 External links: old bug with URL in query
442 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
444 <p>Old bug with URL in query: <a href="http://example.com/thing?url=http://example.com" class='external' title="http://example.com/thing?url=http://example.com">link</a><span class='urlexpansion'> (<i>http://example.com/thing?url=http://example.com</i>)</span>
449 External links: old URL-in-URL bug, mixed protocols
451 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
453 <p>And again with mixed protocols: <a href="ftp://example.com?url=http://example.com" class='external' title="ftp://example.com?url=http://example.com">link</a><span class='urlexpansion'> (<i>ftp://example.com?url=http://example.com</i>)</span>
458 External links: URL in text
460 URL in text: [http://example.com http://example.com]
462 <p>URL in text: <a href="http://example.com" class='external'>http://example.com</a>
467 External links: Clickable images
469 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
471 <p>ja-style clickable images: <a href="http://example.com" class='external' title="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
476 External links: raw ampersand
478 Old & use: http://x&y
480 <p>Old & use: <a href="http://x&y" class='external'>http://x&y</a>
485 External links: www.jpeg.org (bug 554)
489 <p><a href="http://www.jpeg.org" class='external'>http://www.jpeg.org</a>
494 External links: URL within URL (original bug 2)
496 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
498 <p><a href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class='external' title="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a><span class='urlexpansion'> (<i>http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp</i>)</span>
503 BUG 361: URL inside bracketed URL
505 [http://www.example.com/foo http://www.example.com/bar]
507 <p><a href="http://www.example.com/foo" class='external' title="http://www.example.com/foo">http://www.example.com/bar</a><span class='urlexpansion'> (<i>http://www.example.com/foo</i>)</span>
512 BUG 289: ">"-token in URL-tail
514 http://www.example.com/<hello>
516 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a><hello>
521 BUG 289: literal ">"-token in URL-tail
523 http://www.example.com/<b>html</b>
525 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a><b >html</b >
530 BUG 289: ">"-token in bracketed URL
532 [http://www.example.com/<hello> stuff]
534 <p><a href="http://www.example.com/" class='external' title="http://www.example.com/"><hello> stuff</a><span class='urlexpansion'> (<i>http://www.example.com/</i>)</span>
539 BUG 289: literal ">"-token in bracketed URL
541 [http://www.example.com/<b>html</b> stuff]
543 <p><a href="http://www.example.com/" class='external' title="http://www.example.com/"><b >html</b > stuff</a><span class='urlexpansion'> (<i>http://www.example.com/</i>)</span>
548 BUG 289: literal double quote at end of URL
550 http://www.example.com/"hello"
552 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a>"hello"
557 BUG 289: literal double quote in bracketed URL
559 [http://www.example.com/"hello" stuff]
561 <p><a href="http://www.example.com/" class='external' title="http://www.example.com/">"hello" stuff</a><span class='urlexpansion'> (<i>http://www.example.com/</i>)</span>
566 External links: invalid character
568 [http://www.example.com