Correct name for Nauruan according to http://en.wikipedia.org/w/wiki.phtml?title...
[mediawiki.git] / maintenance / parserTests.txt
blob2d7372e9021340b68a8c4d2b5cfbab7acdf3423a
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
4 # $Id$
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.
28 !! article
29 Main Page
30 !! text
31 blah blah
32 !! endarticle
34 ###
35 ### Basic tests
36 ###
37 !! test
38 Blank input
39 !! input
40 !! result
41 !! end
44 !! test
45 Simple paragraph
46 !! input
47 This is a simple paragraph.
48 !! result
49 <p>This is a simple paragraph.
50 </p>
51 !! end
53 !! test
54 Simple list
55 !! input
56 * Item 1
57 * Item 2
58 !! result
59 <ul><li> Item 1
60 </li><li> Item 2
61 </li></ul>
63 !! end
65 !! test
66 Italics and bold
67 !! input
68 * plain
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
82 !! result
83 <ul><li> 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
97 </li></ul>
99 !! end
102 ### <nowiki> test cases
105 !! test
106 <nowiki> unordered list
107 !! input
108 <nowiki>* This is not an unordered list item.</nowiki>
109 !! result
110 <p>* This is not an unordered list item.
111 </p>
112 !! end
114 !! test
115 <nowiki> spacing
116 !! input
117 <nowiki>Lorem ipsum dolor
119 sed abit.
120   sed nullum.
122 :and a colon
123 </nowiki>
124 !! result
125 <p>Lorem ipsum dolor
127 sed abit.
128   sed nullum.
130 :and a colon
132 </p>
133 !! end
135 !! test
136 nowiki 3
137 !! input
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>.
146 !! result
147 <dl><dd>There is not nowiki.
148 </dd><dd>There is nowiki.
149 </dd></dl>
150 <ol><li>There is not nowiki.
151 </li><li>There is nowiki.
152 </li></ol>
153 <ul><li>There is not nowiki.
154 </li><li>There is nowiki.
155 </li></ul>
157 !! end
160 ### comment test cases
162 !! test
163 Comment test 1
164 !! input
165 <!-- comment 1 --> asdf
166 <!-- comment 2 -->
167 !! result
168 <pre>asdf
169 </pre>
171 !! end
173 !! test
174 Comment test 2
175 !! input
176 asdf
177 <!-- comment 1 -->
179 !! result
180 <p>asdf
182 </p>
183 !! end
185 !! test
186 Comment test 3
187 !! input
188 asdf
189 <!-- comment 1 -->
190 <!-- comment 2 -->
192 !! result
193 <p>asdf
195 </p>
196 !! end
198 !! test
199 Comment test 4
200 !! input
201 asdf<!-- comment 1 -->jkl
202 !! result
203 <p>asdfjkl
204 </p>
205 !! end
207 !! test
208 Comment spacing
209 !! input
211  <!-- foo --> b <!-- bar -->
213 !! result
214 <p>a
215 </p>
216 <pre> b 
217 </pre>
218 <p>c
219 </p>
220 !! end
223 ### Preformatted text
225 !! test
226 Preformatted text
227 !! input
228  This is some
229  Preformatted text
230  With ''italic''
231  And '''bold'''
232  And a [[Main Page|link]]
233 !! result
234 <pre>This is some
235 Preformatted text
236 With <i>italic</i>
237 And <b>bold</b>
238 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
239 </pre>
240 !! end
243 ### Definition list
245 !! test
246 Simple definition
247 !! input
248 ; name : Definition
249 !! result
250 <dl><dt> name&nbsp;</dt><dd> Definition
251 </dd></dl>
253 !! end
255 !! test
256 Simple definition
257 !! input
258 : Indented text
259 !! result
260 <dl><dd> Indented text
261 </dd></dl>
263 !! end
265 !! test
266 Definition list with no space
267 !! input
268 ;name:Definition
269 !! result
270 <dl><dt>name</dt><dd>Definition
271 </dd></dl>
273 !!end
275 !! test
276 Definition list with URL link
277 !! input
278 ; http://example.com/ : definition
279 !! result
280 <dl><dt> <a href="http://example.com/" class='external'>http://example.com/</a>&nbsp;</dt><dd> definition
281 </dd></dl>
283 !! end
285 !! test
286 Definition list with bracketed URL link
287 !! input
288 ;[http://www.google.com/ Google]:Number one search engine
289 !! result
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
291 </dd></dl>
293 !! end
295 !! test
296 Definition list with wikilink containing colon
297 !! input
298 ; [[Wikipedia:FAQ]]: The least-read page on Wikipedia
299 !! result
300 <dl><dt> <a href="http://en.wikipedia.org/wiki/FAQ" class='extiw'>Wikipedia:FAQ</a></dt><dd> The least-read page on Wikipedia
301 </dd></dl>
303 !! end
305 # At Brion's and JeLuF's insistence... :)
306 !! test
307 Definition list with wikilink containing colon
308 !! input
309 ;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
310 !! result
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!
312 </dd></dl>
314 !! end
316 !! test
317 Malformed definition list with colon
318 !! input
319 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
320 !! result
321 <dl><dt>  <a href="news:alt.wikipedia.rox" class='external'>news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
322 </dt></dl>
324 !! end
326 !! test
327 Definition lists: colon in external link text
328 !! input
329 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
330 !! result
331 <dl><dt> <a href="http://www.wikipedia2.org/" class='external' title="http://www.wikipedia2.org/">Wikipedia&nbsp;: The Next Generation</a><span class='urlexpansion'> (<i>http://www.wikipedia2.org/</i>)</span></dt><dd> OK, I made that up
332 </dd></dl>
334 !! end
338 ### External links
340 !! test
341 External links: non-bracketed
342 !! input
343 Non-bracketed: http://example.com
344 !! result
345 <p>Non-bracketed: <a href="http://example.com" class='external'>http://example.com</a>
346 </p>
347 !! end
349 !! test
350 External links: numbered
351 !! input
352 Numbered: [http://example.com]
353 !! result
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>
355 </p>
356 !!end
358 !! test
359 External links: specified text
360 !! input
361 Specified text: [http://example.com link]
362 !! result
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>
364 </p>
365 !!end
367 !! test
368 External links: trail
369 !! input
370 Trail (not sure if this is meant to work): [http://example.com link]s
371 !! result
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>
373 </p>
374 !! end
376 !! test
377 External links: dollar sign in URL
378 !! input
379 http://example.com/1$2345
380 !! result
381 <p><a href="http://example.com/1$2345" class='external'>http://example.com/1$2345</a>
382 </p>
383 !! end
385 !! test
386 External links: dollar sign in URL (named)
387 !! input
388 [http://example.com/1$2345]
389 !! result
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>
391 </p>
392 !!end
394 !! test
395 External image
396 !! input
397 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
398 !! result
399 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
400 </p>
401 !! end
403 !! test
404 External image from https
405 !! input
406 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
407 !! result
408 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
409 </p>
410 !! end
412 !! test
413 Link to non-http image, no img tag
414 !! input
415 Link to non-http image, no img tag: ftp://example.com/test.jpg
416 !! result
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>
418 </p>
419 !! end
421 !! test
422 External links: terminating separator
423 !! input
424 Terminating separator: http://example.com/thing,
425 !! result
426 <p>Terminating separator: <a href="http://example.com/thing" class='external'>http://example.com/thing</a>,
427 </p>
428 !! end
430 !! test
431 External links: intervening separator
432 !! input
433 Intervening separator: http://example.com/1,2,3
434 !! result
435 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external'>http://example.com/1,2,3</a>
436 </p>
437 !! end
439 !! test
440 External links: old bug with URL in query
441 !! input
442 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
443 !! result
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>
445 </p>
446 !! end
448 !! test
449 External links: old URL-in-URL bug, mixed protocols
450 !! input
451 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
452 !! result
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>
454 </p>
455 !!end
457 !! test
458 External links: URL in text
459 !! input
460 URL in text: [http://example.com http://example.com]
461 !! result
462 <p>URL in text: <a href="http://example.com" class='external'>http://example.com</a>
463 </p>
464 !! end
466 !! test
467 External links: Clickable images
468 !! input
469 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
470 !! result
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>
472 </p>
473 !!end
475 !! test
476 External links: raw ampersand
477 !! input
478 Old &amp; use: http://x&y
479 !! result
480 <p>Old &amp; use: <a href="http://x&amp;y" class='external'>http://x&amp;y</a>
481 </p>
482 !! end
484 !! test
485 External links: www.jpeg.org (bug 554)
486 !! input
487 http://www.jpeg.org
488 !!result
489 <p><a href="http://www.jpeg.org" class='external'>http://www.jpeg.org</a>
490 </p>
491 !! end
493 !! test
494 External links: URL within URL (original bug 2)
495 !! input
496 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
497 !! result
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>
499 </p>
500 !! end
502 !! test
503 BUG 361: URL inside bracketed URL
504 !! input
505 [http://www.example.com/foo http://www.example.com/bar]
506 !! result
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>
508 </p>
509 !! end
511 !! test
512 BUG 289: ">"-token in URL-tail
513 !! input
514 http://www.example.com/<hello>
515 !! result
516 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a>&lt;hello&gt;
517 </p>
518 !!end
520 !! test
521 BUG 289: literal ">"-token in URL-tail
522 !! input
523 http://www.example.com/<b>html</b>
524 !! result
525 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a><b >html</b >
526 </p>
527 !!end
529 !! test
530 BUG 289: ">"-token in bracketed URL
531 !! input
532 [http://www.example.com/<hello> stuff]
533 !! result
534 <p><a href="http://www.example.com/" class='external' title="http://www.example.com/">&lt;hello&gt; stuff</a><span class='urlexpansion'> (<i>http://www.example.com/</i>)</span>
535 </p>
536 !!end
538 !! test
539 BUG 289: literal ">"-token in bracketed URL
540 !! input
541 [http://www.example.com/<b>html</b> stuff]
542 !! result
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>
544 </p>
545 !!end
547 !! test
548 BUG 289: literal double quote at end of URL
549 !! input
550 http://www.example.com/"hello"
551 !! result
552 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a>"hello"
553 </p>
554 !!end
556 !! test
557 BUG 289: literal double quote in bracketed URL
558 !! input
559 [http://www.example.com/"hello" stuff]
560 !! result
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>
562 </p>
563 !!end
565 !! test
566 External links: invalid character
567 !! input
568 [http://www.example.com\0 test]
569 !! result
570 <p>[<a href="http://www.example.com" class='external'>http://www.example.com</a>\0 test]
571 </p>
572 !! end
575 ### Quotes
578 !! test
579 Quotes
580 !! input
581 Normal text. '''Bold text.''' Normal text. ''Italic text.''
583 Normal text. '''''Bold italic text.''''' Normal text.
584 !!result
585 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
586 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
587 </p>
588 !! end
591 !! test
592 Unclosed and unmatched quotes
593 !! input
594 '''''Bold italic text '''with bold deactivated''' in between.'''''
596 '''''Bold italic text ''with italic deactivated'' in between.'''''
598 '''Bold text..
600 ..spanning two paragraphs (should not work).'''
602 '''Bold tag left open
604 ''Italic tag left open
606 Normal text.
608 <!-- Unmatching number of opening, closing tags: -->
609 '''This year''''s election ''should'' beat '''last year''''s.
611 ''Tom'''s car is bigger than ''Susan'''s.
612 !! result
613 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
614 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
615 </p><p><b>Bold text..</b>
616 </p><p>..spanning two paragraphs (should not work).<b></b>
617 </p><p><b>Bold tag left open</b>
618 </p><p><i>Italic tag left open</i>
619 </p><p>Normal text.
620 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
621 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
622 </p>
623 !! end
626 ### Tables
628 ### content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
630 !! test
631 Simple table
632 !! input
633 {| 
634 | 1 || 2
635 |- 
636 | 3 || 4
638 !! result
639 <table >
640 <tr >
641 <td> 1 </td><td> 2
642 </td></tr>
643 <tr >
644 <td> 3 </td><td> 4
645 </td></tr></table>
647 !! end
649 !! test
650 Multiplication table
651 !! input
652 {| border="1" cellpadding="2"
653 |+Multiplication table
655 ! &times; !! 1 !! 2 !! 3
657 ! 1
658 | 1 || 2 || 3
660 ! 2
661 | 2 || 4 || 6
663 ! 3
664 | 3 || 6 || 9
666 ! 4
667 | 4 || 8 || 12
669 ! 5
670 | 5 || 10 || 15
672 !! result
673 <table border="1" cellpadding="2">
674 <caption>Multiplication table
675 </caption>
676 <tr >
677 <th> &times; </th><th> 1 </th><th> 2 </th><th> 3
678 </th></tr>
679 <tr >
680 <th> 1
681 </th><td> 1 </td><td> 2 </td><td> 3
682 </td></tr>
683 <tr >
684 <th> 2
685 </th><td> 2 </td><td> 4 </td><td> 6
686 </td></tr>
687 <tr >
688 <th> 3
689 </th><td> 3 </td><td> 6 </td><td> 9
690 </td></tr>
691 <tr >
692 <th> 4
693 </th><td> 4 </td><td> 8 </td><td> 12
694 </td></tr>
695 <tr >
696 <th> 5
697 </th><td> 5 </td><td> 10 </td><td> 15
698 </td></tr></table>
700 !! end
702 !! test
703 Table rowspan
704 !! input
705 {| align=right border=1
706 | Cell 1, row 1 
707 |rowspan=2| Cell 2, row 1 (and 2) 
708 | Cell 3, row 1 
709 |- 
710 | Cell 1, row 2 
711 | Cell 3, row 2 
713 !! result
714 <table align=right border=1>
715 <tr >
716 <td> Cell 1, row 1
717 </td><td rowspan=2> Cell 2, row 1 (and 2)
718 </td><td> Cell 3, row 1
719 </td></tr>
720 <tr >
721 <td> Cell 1, row 2
722 </td><td> Cell 3, row 2
723 </td></tr></table>
725 !! end
727 !! test
728 Nested table
729 !! input
730 {| border=1
731 | &alpha;
733 {| bgcolor=#ABCDEF border=2
734 |nested
736 |table
738 |the original table again
740 !! result
741 <table border=1>
742 <tr >
743 <td> &alpha;
744 </td><td>
745 <table bgcolor=#ABCDEF border=2>
746 <tr >
747 <td>nested
748 </td></tr>
749 <tr >
750 <td>table
751 </td></tr></table>
752 </td><td>the original table again
753 </td></tr></table>
755 !! end
758 ### Internal links
760 !! test
761 Plain link, capitalized
762 !! input
763 [[Main Page]]
764 !! result
765 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
766 </p>
767 !! end
769 !! test
770 Plain link, uncapitalized
771 !! input
772 [[main Page]]
773 !! result
774 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
775 </p>
776 !! end
778 !! test
779 Piped link
780 !! input
781 [[Main Page|The Main Page]]
782 !! result
783 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
784 </p>
785 !! end
787 !! test
788 Broken link
789 !! input
790 [[Zigzagzogzagzig]]
791 !! result
792 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
793 </p>
794 !! end
796 !! test
797 Link with prefix
798 !! input
799 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
800 !! result
801 <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>
802 </p>
803 !! end
805 !! test
806 Link with suffix
807 !! input
808 [[Main Page]]xxx, [[Main Page]]XXX
809 !! result
810 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
811 </p>
812 !! end
814 !! test
815 Link with 3 brackets
816 !! input
817 [[[main page]]]
818 !! result
819 <p>[[[main page]]]
820 </p>
821 !! end
823 !! test
824 Piped link with 3 brackets
825 !! input
826 [[[main page|the main page]]]
827 !! result
828 <p>[[[main page|the main page]]]
829 </p>
830 !! end
832 !! test
833 Link to namespaces
834 !! input
835 [[Talk:Parser testing]], [[Meta:Disclaimers]]
836 !! result
837 <p><a href="/index.php?title=Talk:Parser_testing&amp;action=edit" class="new" title="Talk:Parser testing">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">Meta:Disclaimers</a>
838 </p>
839 !! end
841 !! test
842 Piped link to namespace
843 !! input
844 [[Meta:Disclaimers|The disclaimers]]
845 !! result
846 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
847 </p>
848 !! end
850 !! test
851 Link containing }
852 !! input
853 [[Usually caused by a typo (oops}]]
854 !! result
855 <p>[[Usually caused by a typo (oops}]]
856 </p>
857 !! end
859 !! test
860 Link containing % (not as a hex sequence)
861 !! input
862 [[7% Solution]]
863 !! result
864 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
865 </p>
866 !! end
868 !! test
869 Link containing % as a single hex sequence interpreted to char
870 !! input
871 [[7%25 Solution]]
872 !! result
873 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
874 </p>
875 !!end
877 !! test
878 Link containing % as a double hex sequence interpreted to hex sequence
879 !! input
880 [[7%2525 Solution]]
881 !! result
882 <p>[[7%2525 Solution]]
883 </p>
884 !!end
886 !! test
887 Plain link to URL
888 !! input
889 [[http://www.example.org]]
890 !! result
891 <p>[<a href="http://www.example.org" class='external' title="http://www.example.org">[1]</a><span class='urlexpansion'> (<i>http://www.example.org</i>)</span>]
892 </p>
893 !! end
895 # I'm fairly sure the expected result here is wrong.
896 # We want these to be URL links, not pseudo-pages with URLs for titles....
897 # However the current output is also pretty screwy.
899 # ----
900 # I'm changing it to match the current output--it arguably makes more
901 # sense in the light of the test above. Old expected result was:
902 #<p>Piped link to URL: <a href="/index.php?title=Http://www.example.org&amp;action=edit" class="new" title="Http://www.example.org">an example URL</a>
903 #</p>
904 # But I think this test is bordering on "garbage in, garbage out" anyway.
905 # -- wtm
906 !! test
907 Piped link to URL
908 !! input
909 Piped link to URL: [[http://www.example.org|an example URL]]
910 !! result
911 <p>Piped link to URL: [<a href="http://www.example.org|an" class='external' title="http://www.example.org|an">example URL</a><span class='urlexpansion'> (<i>http://www.example.org|an</i>)</span>]
912 </p>
913 !! end
915 !! test
916 BUG 2: [[page|http://url/]] should link to page, not http://url/
917 !! input
918 [[Main Page|http://url/]]
919 !! result
920 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
921 </p>
922 !! end
924 !! test
925 BUG 337: Escaped self-links should be bold
926 !! options
927 title=[[Bug462]]
928 !! input
929 [[Bu&#103;462]] [[Bug462]]
930 !! result
931 <p><strong>Bu&#103;462</strong> <strong>Bug462</strong>
932 </p>
933 !! end
935 !! test
936 Self-link to section should not be bold
937 !! options
938 title=[[Main Page]]
939 !! input
940 [[Main Page#section]]
941 !! result
942 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
943 </p>
944 !! end
946 !! test
947 <nowiki> inside a link
948 !! input
949 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
950 !! result
951 <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>
952 </p>
953 !! end
956 ### Interwiki links
959 !! test
960 Inline interwiki link
961 !! input
962 [[MeatBall:SoftSecurity]]
963 !! result
964 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class='extiw'>MeatBall:SoftSecurity</a>
965 </p>
966 !! end
969 ## XHTML tidiness
972 !! test
973 <br> to <br />
974 !! input
975 1<br>2<br />3
976 !! result
977 <p>1<br />2<br />3
978 </p>
979 !! end
982 ### Block-level elements
984 !! test
985 Common list
986 !! input
987 *Common list
988 * item 2
989 *item 3
990 !! result
991 <ul><li>Common list
992 </li><li> item 2
993 </li><li>item 3
994 </li></ul>
996 !! end
998 !! test
999 Numbered list
1000 !! input
1001 #Numbered list
1002 #item 2
1003 # item 3
1004 !! result
1005 <ol><li>Numbered list
1006 </li><li>item 2
1007 </li><li> item 3
1008 </li></ol>
1010 !! end
1012 !! test
1013 Mixed list
1014 !! input
1015 *Mixed list
1016 *# with numbers
1017 ** and bullets
1018 *# and numbers
1019 *bullets again
1020 **bullet level 2
1021 ***bullet level 3
1022 ***#Number on level 4
1023 **bullet level 2
1024 **#Number on level 3
1025 **#Number on level 3
1026 *#number level 2
1027 *Level 1
1028 !! result
1029 <ul><li>Mixed list
1030 <ol><li> with numbers
1031 </li></ol>
1032 <ul><li> and bullets
1033 </li></ul>
1034 <ol><li> and numbers
1035 </li></ol>
1036 </li><li>bullets again
1037 <ul><li>bullet level 2
1038 <ul><li>bullet level 3
1039 <ol><li>Number on level 4
1040 </li></ol>
1041 </li></ul>
1042 </li><li>bullet level 2
1043 <ol><li>Number on level 3
1044 </li><li>Number on level 3
1045 </li></ol>
1046 </li></ul>
1047 <ol><li>number level 2
1048 </li></ol>
1049 </li><li>Level 1
1050 </li></ul>
1052 !! end
1055 ### Magic variables
1057 !! test
1058 Magic variables
1059 !! input
1060 {{SITENAME}}
1061 !! result
1062 <p>MediaWiki
1063 </p>
1064 !! end
1067 ### Magic links
1069 !! test
1070 Magic links: internal link to RFC
1071 !! input
1072 [[RFC 123]]
1073 !! result
1074 <p><a href="/index.php?title=RFC_123&amp;action=edit" class="new" title="RFC 123">RFC 123</a>
1075 </p>
1076 !! end
1078 !! test
1079 Magic links: RFC
1080 !! input
1081 RFC 822
1082 !! result
1083 <p><a href='http://www.faqs.org/rfcs/rfc822.html' class='external' title="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>
1084 </p>
1085 !! end
1087 !! test
1088 Magic links: ISBN
1089 !! input
1090 ISBN 0-306-40615-2
1091 !! result
1092 <p><a href="/index.php?title=Special:Booksources&amp;isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1093 </p>
1094 !! end
1097 ### Templates
1098 ####
1100 !! test
1101 Nonexistant template
1102 !! input
1103 {{thistemplatedoesnotexist}}
1104 !! result
1105 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1106 </p>
1107 !! end
1109 !! article
1110 Template:test
1111 !! text
1112 This is a test template
1113 !! endarticle
1115 !! test
1116 Simple template
1117 !! input
1118 {{test}}
1119 !! result
1120 <p>This is a test template
1121 </p>
1122 !! end
1124 !! test
1125 Template with explicit namespace
1126 !! input
1127 {{Template:test}}
1128 !! result
1129 <p>This is a test template
1130 </p>
1131 !! end
1134 !! article
1135 Template:paramtest
1136 !! text
1137 This is a test template with parameter {{{param}}}
1138 !! endarticle
1140 !! test
1141 Template parameter
1142 !! input
1143 {{paramtest|param=foo}}
1144 !! result
1145 <p>This is a test template with parameter foo
1146 </p>
1147 !! end
1149 !! article
1150 Template:paramtestnum
1151 !! text
1152 [[{{{1}}}|{{{2}}}]]
1153 !! endarticle
1155 !! test
1156 Template unnamed parameter
1157 !! input
1158 {{paramtestnum|Main Page|the main page}}
1159 !! result
1160 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
1161 </p>
1162 !! end
1164 !! test
1165 BUG 553: link with two variables in a piped link
1166 !! input
1167 {| 
1168 |[[{{{1}}}|{{{2}}}]]
1170 !! result
1171 <table >
1172 <tr >
1173 <td>[[{{{1}}}|{{{2}}}]]
1174 </td></tr></table>
1176 !! end
1178 !! test
1179 Magic variable as template parameter
1180 !! input
1181 {{paramtest|param={{SITENAME}}}}
1182 !! result
1183 <p>This is a test template with parameter MediaWiki
1184 </p>
1185 !! end
1187 !! article
1188 Template:linktest
1189 !! text
1190 [[{{{param}}}|link]]
1191 !! endarticle
1193 !! test
1194 Template parameter as link source
1195 !! input
1196 {{linktest|param=Main Page}}
1197 !! result
1198 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
1199 </p>
1200 !! end
1203 !!article
1204 Template:paramtest2
1205 !! text
1206 including another template, {{paramtest|param={{{arg}}}}}
1207 !! endarticle
1209 !! test
1210 Template passing argument to another template
1211 !! input
1212 {{paramtest2|arg='hmm'}}
1213 !! result
1214 <p>including another template, This is a test template with parameter 'hmm'
1215 </p>
1216 !! end
1218 !! article
1219 Template:Linktest2
1220 !! text
1221 Main Page
1222 !! endarticle
1224 !! test
1225 Template as link source
1226 !! input
1227 [[{{linktest2}}]]
1228 !! result
1229 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1230 </p>
1231 !! end
1234 !! article
1235 Template:loop1
1236 !! text
1237 {{loop2}}
1238 !! endarticle
1240 !! article
1241 Template:loop2
1242 !! text
1243 {{loop1}}
1244 !! endarticle
1246 !! test
1247 Template infinite loop
1248 !! input
1249 {{loop1}}
1250 !! result
1251 <p>{{loop2}}<!-- WARNING: template loop detected -->
1252 </p>
1253 !! end
1255 !! test
1256 Template from main namespace
1257 !! input
1258 {{:Main Page}}
1259 !! result
1260 <p>blah blah
1261 </p>
1262 !! end
1264 !! article
1265 Template:table
1266 !! text
1267 {| 
1268 | 1 || 2
1269 |- 
1270 | 3 || 4
1272 !! endarticle
1274 !! test
1275 BUG 529: Template with table, not included at beginning of line
1276 !! input
1277 foo {{table}}
1278 !! result
1279 <p>foo 
1280 </p>
1281 <table >
1282 <tr >
1283 <td> 1 </td><td> 2
1284 </td></tr>
1285 <tr >
1286 <td> 3 </td><td> 4
1287 </td></tr></table>
1289 !! end
1291 !! test
1292 BUG 523: Template shouldn't eat newline (or add an extra one before table)
1293 !! input
1295 {{table}}
1296 !! result
1297 <p>foo
1298 </p>
1299 <table >
1300 <tr >
1301 <td> 1 </td><td> 2
1302 </td></tr>
1303 <tr >
1304 <td> 3 </td><td> 4
1305 </td></tr></table>
1307 !! end
1309 !! test
1310 BUG 41: Template parameters shown as broken links
1311 !! input
1312 {{{parameter}}}
1313 !! result
1314 <p>{{{parameter}}}
1315 </p>
1316 !! end
1319 !! article
1320 Template:MSGNW test
1321 !! text
1322 ''None'' of '''this''' should be 
1323 * interepreted
1324  but rather passed unmodified
1325 {{test}}
1326 !! endarticle
1328 # hmm, fix this or just deprecate msgnw and document its behavior?
1329 !! test
1330 msgnw keyword
1331 !! options
1332 disabled
1333 !! input
1334 {{msgnw:MSGNW test}}
1335 !! result
1336 <p>''None'' of '''this''' should be 
1337 * interepreted
1338  but rather passed unmodified
1339 {{test}}
1340 </p>
1341 !! end
1343 !! test
1344 int keyword
1345 !! input
1346 {{int:newmessages|lots of money}}
1347 !! result
1348 <p>You have lots of money.
1349 </p>
1350 !! end
1353 ### Pre-save transform tests
1355 !! test
1356 pre-save transform: subst:
1357 !! options
1359 !! input
1360 {{subst:test}}
1361 !! result
1362 This is a test template
1363 !! end
1365 !! test
1366 pre-save transform: normal template
1367 !! options
1369 !! input
1370 {{test}}
1371 !! result
1372 {{test}}
1373 !! end
1375 !! test
1376 pre-save transform: nonexistant template
1377 !! options
1379 !! input
1380 {{thistemplatedoesnotexist}}
1381 !! result
1382 {{thistemplatedoesnotexist}}
1383 !! end
1386 !! test
1387 pre-save transform: subst magic variables
1388 !! options
1390 !! input
1391 {{subst:SITENAME}}
1392 !! result
1393 MediaWiki
1394 !! end
1396 # This is bug 89, which I fixed. -- wtm
1397 !! test
1398 pre-save transform: subst: templates with parameters
1399 !! options
1401 !! input
1402 {{subst:paramtest|param="something else"}}
1403 !! result
1404 This is a test template with parameter "something else"
1405 !! end
1408 ### Message transform tests
1410 !! test
1411 message transform: magic variables
1412 !! options
1414 !! input
1415 {{SITENAME}}
1416 !! result
1417 MediaWiki
1418 !! end
1420 !! test
1421 message transform: should not transform wiki markup
1422 !! options
1424 !! input
1425 ''test''
1426 !! result
1427 ''test''
1428 !! end
1431 ### Images
1433 !! test
1434 Simple image
1435 !! input
1436 [[Image:foobar.jpg]]
1437 !! result
1438 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" longdesc="/wiki/Image:Foobar.jpg" /></a>
1439 </p>
1440 !! end
1442 !! test
1443 Right-aligned image
1444 !! input
1445 [[Image:foobar.jpg|right]]
1446 !! result
1447 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="/images/3/3a/Foobar.jpg" alt="" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
1449 !! end
1451 !! test
1452 Image with caption
1453 !! input
1454 [[Image:foobar.jpg|right|Caption text]]
1455 !! result
1456 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title="Caption text"><img src="/images/3/3a/Foobar.jpg" alt="Caption text" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
1458 !! end
1460 !! test
1461 Image with frame and link
1462 !! input
1463 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
1464 !! result
1465 <div class="thumb tleft"><div style="width:202px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is a test image "><img src="/images/3/3a/Foobar.jpg" alt="This is a test image " width="200" height="200" 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>
1467 !! end
1469 !! test
1470 Link to image page
1471 !! input
1472 [[:Image:test]]
1473 !! result
1474 <p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
1475 </p>
1476 !! end
1478 !! test
1479 Frameless image caption with a free URL
1480 !! input
1481 [[Image:foobar.jpg|http://example.com]]
1482 !! result
1483 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img src="/images/3/3a/Foobar.jpg" alt="http://example.com" longdesc="/wiki/Image:Foobar.jpg" /></a>
1484 </p>
1485 !! end
1487 !! test
1488 Thumbnail image caption with a free URL
1489 !! input
1490 [[Image:foobar.jpg|thumb|http://example.com]]
1491 !! result
1492 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="http://example.com"><img src="/images/3/3a/Foobar.jpg" alt="http://example.com" width="180" height="180" 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'>http://example.com</a></div></div></div>
1494 !! end
1496 # Pending resolution to bug 368
1497 !! test
1498 BUG 648: Frameless image caption with a link
1499 !! input
1500 [[Image:foobar.jpg|text with a [[link]] in it]]
1501 !! result
1502 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img src="/images/3/3a/Foobar.jpg" alt="text with a link in it" longdesc="/wiki/Image:Foobar.jpg" /></a>
1503 </p>
1504 !! end
1506 !! test
1507 Escape HTML special chars in image alt text
1508 !! input
1509 [[Image:foobar.jpg|& < > "]]
1510 !! result
1511 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img src="/images/3/3a/Foobar.jpg" alt="&amp; &lt; &gt; &quot;" longdesc="/wiki/Image:Foobar.jpg" /></a>
1512 </p>
1513 !! end
1515 !! test
1516 BUG 499: Alt text should have &#1234;, not &amp;1234;
1517 !! input
1518 [[Image:foobar.jpg|&#9792;]]
1519 !! result
1520 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="&#9792;"><img src="/images/3/3a/Foobar.jpg" alt="&#9792;" longdesc="/wiki/Image:Foobar.jpg" /></a>
1521 </p>
1522 !! end
1524 !! test
1525 Broken image caption with link
1526 !! input
1527 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
1528 !! result
1529 <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.
1530 </p>
1531 !! end
1533 !! test
1534 Image caption containing another image
1535 !! input
1536 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
1537 !! result
1538 <div class="thumb tright"><div style="width:182px;"><b>Missing image</b><br /><i>Foobar.jpg</i>   <div class="thumbcaption" >This is a caption with another <a href="/wiki/Image:Icon.png" class="image" title="image"><img src="/images/9/96/Icon.png" alt="image" longdesc="/wiki/Image:Icon.png" /></a> inside it!</div></div></div>
1540 !! end
1543 ### Subpages
1545 !! article
1546 Subpage test/subpage
1547 !! text
1549 !! endarticle
1551 !! test
1552 Subpage link
1553 !! options
1554 subpage title=[[Subpage test]]
1555 !! input
1556 [[/subpage]]
1557 !! result
1558 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
1559 </p>
1560 !! end
1562 !! test
1563 Subpage noslash link
1564 !! options
1565 subpage title=[[Subpage test]]
1566 !!input
1567 [[/subpage/]]
1568 !! result
1569 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
1570 </p>
1571 !! end
1573 !! test
1574 Disabled subpages
1575 !! input
1576 [[/subpage]]
1577 !! result
1578 <p><a href="/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
1579 </p>
1580 !! end
1582 !! test
1583 BUG 561: {{/Subpage}}
1584 !! options
1585 subpage title=[[Page]]
1586 !! input
1587 {{/Subpage}}
1588 !! result
1589 <p><a href="/index.php?title=Page/Subpage&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
1590 </p>
1591 !! end
1594 ### Categories
1596 !! article
1597 Category:MediaWiki User's Guide
1598 !! text
1599 blah
1600 !! endarticle
1602 !! test
1603 Link to category
1604 !! input
1605 [[:Category:MediaWiki User's Guide]]
1606 !! result
1607 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
1608 </p>
1609 !! end
1611 !! test
1612 Simple category
1613 !! options
1615 !! input
1616 [[Category: MediaWiki User's Guide]]
1617 !! result
1618 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
1619 !! end
1622 ### Inter-language links
1624 !! test
1625 Inter-language links
1626 !! options
1628 !! input
1629 [[es:Alimento]]
1630 [[fr:Nourriture]]
1631 [[zh:&#39135;&#21697;]]
1632 !! result
1633 es:Alimento fr:Nourriture zh:食品
1634 !! end
1637 ### Sections
1639 !! test
1640 Basic section headings
1641 !! options
1642 title=[[Parser test script]]
1643 !! input
1644 == Headline 1 ==
1645 Some text
1647 ==Headline 2==
1648 More
1649 ===Smaller headline===
1650 Blah blah
1651 !! result
1652 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Parser test script">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
1653 <p>Some text
1654 </p>
1655 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Headline_2"></a><h2>Headline 2</h2>
1656 <p>More
1657 </p>
1658 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Parser test script">edit</a>]</div><a name="Smaller_headline"></a><h3>Smaller headline</h3>
1659 <p>Blah blah
1660 </p>
1661 !! end
1663 !! test
1664 Section headings with TOC
1665 !! options
1666 title=[[Parser test script]]
1667 !! input
1668 == Headline 1 ==
1669 === Subheadline 1 ===
1670 ===== Skipping a level =====
1671 ====== Skipping a level ======
1673 == Headline 2 ==
1674 Some text
1675 ===Another headline===
1676 !! result
1677 <table border="0" id="toc"><tr id="toctitle"><td align="center">
1678 <b>Table of contents</b> <script type="text/javascript">showTocToggle("show","hide")</script></td></tr><tr id="tocinside"><td>
1679 <div class="tocline"><a href="#Headline_1">1 Headline 1</a><br /></div>
1680 <div class="tocindent">
1681 <p><a href="#Subheadline_1">1.1 Subheadline 1</a><br />
1682 </p>
1683 <div class="tocindent">
1684 <div class="tocindent">
1685 <p><a href="#Skipping_a_level">1.1.1 Skipping a level</a><br />
1686 </p>
1687 <div class="tocindent">
1688 <p><a href="#Skipping_a_level_2">1.1.1.1 Skipping a level</a><br />
1689 </p>
1690 </div>
1691 </div>
1692 </div>
1693 </div>
1694 <div class="tocline"><a href="#Headline_2">2 Headline 2</a><br /></div>
1695 <div class="tocindent">
1696 <p><a href="#Another_headline">2.1 Another headline</a><br />
1697 </p>
1698 </div>
1699 </td></tr></table>
1700 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Parser test script">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
1701 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Subheadline_1"></a><h3> Subheadline 1 </h3>
1702 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Parser test script">edit</a>]</div><a name="Skipping_a_level"></a><h5> Skipping a level </h5>
1703 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=4" title="Parser test script">edit</a>]</div><a name="Skipping_a_level_2"></a><h6> Skipping a level </h6>
1704 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=5" title="Parser test script">edit</a>]</div><a name="Headline_2"></a><h2> Headline 2 </h2>
1705 <p>Some text
1706 </p>
1707 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=6" title="Parser test script">edit</a>]</div><a name="Another_headline"></a><h3>Another headline</h3>
1709 !! end
1711 !! test
1712 Resolving duplicate section names
1713 !! options
1714 title=[[Parser test script]]
1715 !! input
1716 == Foo bar ==
1717 ==Foo bar==
1718 !! result
1719 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Parser test script">edit</a>]</div><a name="Foo_bar"></a><h2> Foo bar </h2>
1720 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Foo_bar_2"></a><h2>Foo bar</h2>
1722 !! end
1724 !! article
1725 Template:sections
1726 !! text
1727 ===Section 1===
1728 ==Section 2==
1729 !! endarticle
1731 !! test
1732 Template with sections, __NOTOC__
1733 !! options
1734 title=[[Parser test script]]
1735 !! input
1736 __NOTOC__
1737 ==Section 0==
1738 {{sections}}
1739 ==Section 4==
1740 !! result
1741 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Parser test script">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
1742 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
1743 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
1744 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
1746 !! end
1748 !! test
1749 __NOEDITSECTION__ keyword
1750 !! input
1751 __NOEDITSECTION__
1752 ==Section 1==
1753 ==Section 2==
1754 !! result
1755 <a name="Section_1"></a><h2>Section 1</h2>
1756 <a name="Section_2"></a><h2>Section 2</h2>
1758 !! end
1760 !! test
1761 Link inside a section heading
1762 !! options
1763 title=[[Parser test script]]
1764 !! input
1765 ==Section with a [[Main Page|link]] in it==
1766 !! result
1767 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;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>
1769 !! end
1771 TODO:
1772 more images
1773 more tables
1774 math
1775 character entities
1776 and much more