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 # noxml don't check for XML well formdness
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.
165 <!-- comment 1 --> asdf
201 asdf<!-- comment 1 -->jkl
211 <!-- foo --> b <!-- bar -->
225 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
231 Comment semantics and delimiters
233 <!-- --><!----><!-----><!------>
239 Comment semantics and delimiters, redux
241 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
242 -- foo -- funky huh? ... -->
248 Comment semantics and delimiters: directors cut
250 <!-- ... However we're purely an XML shop you see, so we eat everything
251 starting with < followed by !-- until the first -- and > we see, observe: -->-->
258 Comment semantics: nesting
260 <!--<!-- no, we're not going to do anything fancy here -->-->
268 ### Preformatted text
277 And a [[Main Page|link]]
283 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
295 <dl><dt> name </dt><dd> Definition
305 <dl><dd> Indented text
311 Definition list with no space
315 <dl><dt>name</dt><dd>Definition
321 Definition list with URL link
323 ; http://example.com/ : definition
325 <dl><dt> <a href="http://example.com/" class='external free' title="http://example.com/" rel="nofollow">http://example.com/</a> </dt><dd> definition
331 Definition list with bracketed URL link
333 ;[http://www.google.com/ Google]:Number one search engine
335 <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
341 Definition list with wikilink containing colon
343 ; [[Help:FAQ]]: The least-read page on Wikipedia
345 <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
350 # At Brion's and JeLuF's insistence... :)
352 Definition list with wikilink containing colon
354 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
356 <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!
362 Malformed definition list with colon
364 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
366 <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
372 Definition lists: colon in external link text
374 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
376 <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
386 External links: non-bracketed
388 Non-bracketed: http://example.com
390 <p>Non-bracketed: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
395 External links: numbered
397 Numbered: [http://example.com]
398 Numbered: [http://example.net]
399 Numbered: [http://example.org]
401 <p>Numbered: <a href="http://example.com" class='external autonumber' title="http://example.com" rel="nofollow">[1]</a>
402 Numbered: <a href="http://example.net" class='external autonumber' title="http://example.net" rel="nofollow">[2]</a>
403 Numbered: <a href="http://example.org" class='external autonumber' title="http://example.org" rel="nofollow">[3]</a>
408 External links: specified text
410 Specified text: [http://example.com link]
412 <p>Specified text: <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow">link</a>
417 External links: trail
419 Linktrails should not work for external links: [http://example.com link]s
421 <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
426 External links: dollar sign in URL
428 http://example.com/1$2345
430 <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>
435 External links: dollar sign in URL (named)
437 [http://example.com/1$2345]
439 <p><a href="http://example.com/1$2345" class='external autonumber' title="http://example.com/1$2345" rel="nofollow">[1]</a>
444 External links: open square bracket forbidden in URL (bug 4377)
446 http://example.com/1[2345
448 <p><a href="http://example.com/1" class='external free' title="http://example.com/1" rel="nofollow">http://example.com/1</a>[2345
453 External links: open square bracket forbidden in URL (named) (bug 4377)
455 [http://example.com/1[2345]
457 <p><a href="http://example.com/1" class='external text' title="http://example.com/1" rel="nofollow">[2345</a>
464 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
466 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
471 External image from https
473 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
475 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
480 Link to non-http image, no img tag
482 Link to non-http image, no img tag: ftp://example.com/test.jpg
484 <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>
489 External links: terminating separator
491 Terminating separator: http://example.com/thing,
493 <p>Terminating separator: <a href="http://example.com/thing" class='external free' title="http://example.com/thing" rel="nofollow">http://example.com/thing</a>,
498 External links: intervening separator
500 Intervening separator: http://example.com/1,2,3
502 <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>
507 External links: old bug with URL in query
509 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
511 <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>
516 External links: old URL-in-URL bug, mixed protocols
518 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
520 <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>
525 External links: URL in text
527 URL in text: [http://example.com http://example.com]
529 <p>URL in text: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
534 External links: Clickable images
536 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
538 <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>
543 External links: raw ampersand
545 Old & use: http://x&y
547 <p>Old & use: <a href="http://x&y" class='external free' title="http://x&y" rel="nofollow">http://x&y</a>
552 External links: encoded ampersand
554 Old & use: http://x&y
556 <p>Old & use: <a href="http://x&y" class='external free' title="http://x&y" rel="nofollow">http://x&y</a>
561 External links: [raw ampersand]
563 Old & use: [http://x&y]
565 <p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
570 External links: [encoded ampersand]
572 Old & use: [http://x&y]
574 <p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
579 External links: www.jpeg.org (bug 554)
583 <p><a href="http://www.jpeg.org" class='external free' title="http://www.jpeg.org" rel="nofollow">http://www.jpeg.org</a>
588 External links: URL within URL (original bug 2)
590 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
592 <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>
597 BUG 361: URL inside bracketed URL
599 [http://www.example.com/foo http://www.example.com/bar]
601 <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>
606 BUG 361: URL within URL, not bracketed
608 http://www.example.com/foo?=http://www.example.com/bar
610 <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>
615 BUG 289: ">"-token in URL-tail
617 http://www.example.com/<hello>
619 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a><hello>
624 BUG 289: literal ">"-token in URL-tail
626 http://www.example.com/<b>html</b>
628 <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>
633 BUG 289: ">"-token in bracketed URL
635 [http://www.example.com/<hello> stuff]
637 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow"><hello> stuff</a>
642 BUG 289: literal ">"-token in bracketed URL
644 [http://www.example.com/<b>html</b> stuff]
646 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow"><b>html</b> stuff</a>
651 BUG 289: literal double quote at end of URL
653 http://www.example.com/"hello"
655 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a>"hello"
660 BUG 289: literal double quote in bracketed URL
662 [http://www.example.com/"hello" stuff]
664 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow">"hello" stuff</a>
669 External links: invalid character
671 [http://www.example.com