Profiling points. Bump version to 1.4.0beta0; update HISTORY notes to current 1.3...
[mediawiki.git] / maintenance / parserTests.txt
blob23bf77b44f4086a4cccd977467e1953a6fe90565
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.
27 !! article
28 Main Page
29 !! text
30 blah blah
31 !! endarticle
33 ###
34 ### Basic tests
35 ###
36 !! test
37 Blank input
38 !! input
39 !! result
40 !! end
43 !! test
44 Simple paragraph
45 !! input
46 This is a simple paragraph.
47 !! result
48 <p>This is a simple paragraph.
49 </p>
50 !! end
52 !! test
53 Simple list
54 !! input
55 * Item 1
56 * Item 2
57 !! result
58 <ul><li> Item 1
59 </li><li> Item 2
60 </li></ul>
62 !! end
64 !! test
65 Italics and bold
66 !! input
67 * plain
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
81 !! result
82 <ul><li> 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
96 </li></ul>
98 !! end
101 ### <nowiki> test cases
104 !! test
105 <nowiki> unordered list
106 !! input
107 <nowiki>* This is not an unordered list item.</nowiki>
108 !! result
109 <p>* This is not an unordered list item.
110 </p>
111 !! end
113 !! test
114 <nowiki> spacing
115 !! input
116 <nowiki>Lorem ipsum dolor
118 sed abit.
119   sed nullum.
121 :and a colon
122 </nowiki>
123 !! result
124 <p>Lorem ipsum dolor
126 sed abit.
127   sed nullum.
129 :and a colon
131 </p>
132 !! end
134 !! test
135 nowiki 3
136 !! input
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>.
145 !! result
146 <dl><dd>There is not nowiki.
147 </dd><dd>There is nowiki.
148 </dd></dl>
149 <ol><li>There is not nowiki.
150 </li><li>There is nowiki.
151 </li></ol>
152 <ul><li>There is not nowiki.
153 </li><li>There is nowiki.
154 </li></ul>
156 !! end
159 ### comment test cases
161 !! test
162 Comment test 1
163 !! input
164 <!-- comment 1 --> asdf
165 <!-- comment 2 -->
166 !! result
167 <pre>asdf
168 </pre>
170 !! end
172 !! test
173 Comment test 2
174 !! input
175 asdf
176 <!-- comment 1 -->
178 !! result
179 <p>asdf
181 </p>
182 !! end
184 !! test
185 Comment test 3
186 !! input
187 asdf
188 <!-- comment 1 -->
189 <!-- comment 2 -->
191 !! result
192 <p>asdf
194 </p>
195 !! end
197 !! test
198 Comment test 4
199 !! input
200 asdf<!-- comment 1 -->jkl
201 !! result
202 <p>asdfjkl
203 </p>
204 !! end
206 !! test
207 Comment spacing
208 !! input
210  <!-- foo --> b <!-- bar -->
212 !! result
213 <p>a
214 </p>
215 <pre> b 
216 </pre>
217 <p>c
218 </p>
219 !! end
222 ### Preformatted text
224 !! test
225 Preformatted text
226 !! input
227  This is some
228  Preformatted text
229  With ''italic''
230  And '''bold'''
231  And a [[Main Page|link]]
232 !! result
233 <pre>This is some
234 Preformatted text
235 With <i>italic</i>
236 And <b>bold</b>
237 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
238 </pre>
239 !! end
242 ### Definition list
244 !! test
245 Simple definition
246 !! input
247 ; name : Definition
248 !! result
249 <dl><dt> name&nbsp;</dt><dd> Definition
250 </dd></dl>
252 !! end
254 !! test
255 Simple definition
256 !! input
257 : Indented text
258 !! result
259 <dl><dd> Indented text
260 </dd></dl>
262 !! end
264 !! test
265 Definition list with no space
266 !! input
267 ;name:Definition
268 !! result
269 <dl><dt>name</dt><dd>Definition
270 </dd></dl>
272 !!end
274 !! test
275 Definition list with URL link
276 !! input
277 ; http://example.com/ : definition
278 !! result
279 <dl><dt> <a href="http://example.com/" class='external'>http://example.com/</a>&nbsp;</dt><dd> definition
280 </dd></dl>
282 !! end
284 !! test
285 Definition list with bracketed URL link
286 !! input
287 ;[http://www.google.com/ Google]:Number one search engine
288 !! result
289 <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
290 </dd></dl>
292 !! end
294 !! test
295 Definition list with wikilink containing colon
296 !! input
297 ; [[Wikipedia:FAQ]]: The least-read page on Wikipedia
298 !! result
299 <dl><dt> <a href="http://en.wikipedia.org/wiki/FAQ" class='extiw'>Wikipedia:FAQ</a></dt><dd> The least-read page on Wikipedia
300 </dd></dl>
302 !! end
304 # At Brion's and JeLuF's insistence... :)
305 !! test
306 Definition list with wikilink containing colon
307 !! input
308 ;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
309 !! result
310 <dl><dt>  <a href="news:alt.wikipedia.rox" class='external'>news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
311 </dd></dl>
313 !! end
315 !! test
316 Malformed definition list with colon
317 !! input
318 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
319 !! result
320 <dl><dt>  <a href="news:alt.wikipedia.rox" class='external'>news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
321 </dt></dl>
323 !! end
325 !! test
326 Definition lists: colon in external link text
327 !! input
328 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
329 !! result
330 <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
331 </dd></dl>
333 !! end
337 ### External links
339 !! test
340 External links: non-bracketed
341 !! input
342 Non-bracketed: http://example.com
343 !! result
344 <p>Non-bracketed: <a href="http://example.com" class='external'>http://example.com</a>
345 </p>
346 !! end
348 !! test
349 External links: numbered
350 !! input
351 Numbered: [http://example.com]
352 !! result
353 <p>Numbered: <a href="http://example.com" class='external' title="http://example.com">[1]</a><span class='urlexpansion'> (<i>http://example.com</i>)</span>
354 </p>
355 !!end
357 !! test
358 External links: specified text
359 !! input
360 Specified text: [http://example.com link]
361 !! result
362 <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>
363 </p>
364 !!end
366 !! test
367 External links: trail
368 !! input
369 Trail (not sure if this is meant to work): [http://example.com link]s
370 !! result
371 <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>
372 </p>
373 !! end
375 !! test
376 External links: dollar sign in URL
377 !! input
378 http://example.com/1$2345
379 !! result
380 <p><a href="http://example.com/1$2345" class='external'>http://example.com/1$2345</a>
381 </p>
382 !! end
384 !! test
385 External links: dollar sign in URL (named)
386 !! input
387 [http://example.com/1$2345]
388 !! result
389 <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>
390 </p>
391 !!end
393 !! test
394 External image
395 !! input
396 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
397 !! result
398 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
399 </p>
400 !! end
402 !! test
403 External image from https
404 !! input
405 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
406 !! result
407 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
408 </p>
409 !! end
411 !! test
412 Link to non-http image, no img tag
413 !! input
414 Link to non-http image, no img tag: ftp://example.com/test.jpg
415 !! result
416 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class='external'>ftp://example.com/test.jpg</a>
417 </p>
418 !! end
420 !! test
421 External links: terminating separator
422 !! input
423 Terminating separator: http://example.com/thing,
424 !! result
425 <p>Terminating separator: <a href="http://example.com/thing" class='external'>http://example.com/thing</a>,
426 </p>
427 !! end
429 !! test
430 External links: intervening separator
431 !! input
432 Intervening separator: http://example.com/1,2,3
433 !! result
434 <p>Intervening separator: <a href="http://example.com/1,2,3" class='external'>http://example.com/1,2,3</a>
435 </p>
436 !! end
438 !! test
439 External links: old bug with URL in query
440 !! input
441 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
442 !! result
443 <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>
444 </p>
445 !! end
447 !! test
448 External links: old URL-in-URL bug, mixed protocols
449 !! input
450 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
451 !! result
452 <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>
453 </p>
454 !!end
456 !! test
457 External links: URL in text
458 !! input
459 URL in text: [http://example.com http://example.com]
460 !! result
461 <p>URL in text: <a href="http://example.com" class='external'>http://example.com</a>
462 </p>
463 !! end
465 !! test
466 External links: Clickable images
467 !! input
468 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
469 !! result
470 <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>
471 </p>
472 !!end
474 !! test
475 External links: raw ampersand
476 !! input
477 Old &amp; use: http://x&y
478 !! result
479 <p>Old &amp; use: <a href="http://x&amp;y" class='external'>http://x&amp;y</a>
480 </p>
481 !! end
483 !! test
484 External links: www.jpeg.org (bug 554)
485 !! input
486 http://www.jpeg.org
487 !!result
488 <p><a href="http://www.jpeg.org" class='external'>http://www.jpeg.org</a>
489 </p>
490 !! end
492 !! test
493 External links: URL within URL (original bug 2)
494 !! input
495 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
496 !! result
497 <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>
498 </p>
499 !! end
501 !! test
502 BUG 361: URL inside bracketed URL
503 !! input
504 [http://www.example.com/foo http://www.example.com/bar]
505 !! result
506 <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>
507 </p>
508 !! end
510 !! test
511 BUG 289: ">"-token in URL-tail
512 !! input
513 http://www.example.com/<hello>
514 !! result
515 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a>&lt;hello&gt;
516 </p>
517 !!end
519 !! test
520 BUG 289: literal ">"-token in URL-tail
521 !! input
522 http://www.example.com/<b>html</b>
523 !! result
524 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a><b >html</b >
525 </p>
526 !!end
528 !! test
529 BUG 289: ">"-token in bracketed URL
530 !! input
531 [http://www.example.com/<hello> stuff]
532 !! result
533 <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>
534 </p>
535 !!end
537 !! test
538 BUG 289: literal ">"-token in bracketed URL
539 !! input
540 [http://www.example.com/<b>html</b> stuff]
541 !! result
542 <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>
543 </p>
544 !!end
546 !! test
547 BUG 289: literal double quote at end of URL
548 !! input
549 http://www.example.com/"hello"
550 !! result
551 <p><a href="http://www.example.com/" class='external'>http://www.example.com/</a>"hello"
552 </p>
553 !!end
555 !! test
556 BUG 289: literal double quote in bracketed URL
557 !! input
558 [http://www.example.com/"hello" stuff]
559 !! result
560 <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>
561 </p>
562 !!end
564 !! test
565 External links: invalid character
566 !! input
567 [http://www.example.com\0 test]
568 !! result
569 <p>[<a href="http://www.example.com" class='external'>http://www.example.com</a>\0 test]
570 </p>
571 !! end
574 ### Quotes
577 !! test
578 Quotes
579 !! input
580 Normal text. '''Bold text.''' Normal text. ''Italic text.''
582 Normal text. '''''Bold italic text.''''' Normal text.
583 !!result
584 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
585 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
586 </p>
587 !! end
590 !! test
591 Unclosed and unmatched quotes
592 !! input
593 '''''Bold italic text '''with bold deactivated''' in between.'''''
595 '''''Bold italic text ''with italic deactivated'' in between.'''''
597 '''Bold text..
599 ..spanning two paragraphs (should not work).'''
601 '''Bold tag left open
603 ''Italic tag left open
605 Normal text.
607 <!-- Unmatching number of opening, closing tags: -->
608 '''This year''''s election ''should'' beat '''last year''''s.
610 ''Tom'''s car is bigger than ''Susan'''s.
611 !! result
612 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
613 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
614 </p><p><b>Bold text..</b>
615 </p><p>..spanning two paragraphs (should not work).<b></b>
616 </p><p><b>Bold tag left open</b>
617 </p><p><i>Italic tag left open</i>
618 </p><p>Normal text.
619 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
620 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
621 </p>
622 !! end
625 ### Tables
627 ### content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
629 !! test
630 Simple table
631 !! input
632 {| 
633 | 1 || 2
634 |- 
635 | 3 || 4
637 !! result
638 <table >
639 <tr >
640 <td> 1 </td><td> 2
641 </td></tr>
642 <tr >
643 <td> 3 </td><td> 4
644 </td></tr></table>
646 !! end
648 !! test
649 Multiplication table
650 !! input
651 {| border="1" cellpadding="2"
652 |+Multiplication table
654 ! &times; !! 1 !! 2 !! 3
656 ! 1
657 | 1 || 2 || 3
659 ! 2
660 | 2 || 4 || 6
662 ! 3
663 | 3 || 6 || 9
665 ! 4
666 | 4 || 8 || 12
668 ! 5
669 | 5 || 10 || 15
671 !! result
672 <table border="1" cellpadding="2">
673 <caption>Multiplication table
674 </caption>
675 <tr >
676 <th> &times; </th><th> 1 </th><th> 2 </th><th> 3
677 </th></tr>
678 <tr >
679 <th> 1
680 </th><td> 1 </td><td> 2 </td><td> 3
681 </td></tr>
682 <tr >
683 <th> 2
684 </th><td> 2 </td><td> 4 </td><td> 6
685 </td></tr>
686 <tr >
687 <th> 3
688 </th><td> 3 </td><td> 6 </td><td> 9
689 </td></tr>
690 <tr >
691 <th> 4
692 </th><td> 4 </td><td> 8 </td><td> 12
693 </td></tr>
694 <tr >
695 <th> 5
696 </th><td> 5 </td><td> 10 </td><td> 15
697 </td></tr></table>
699 !! end
701 !! test
702 Table rowspan
703 !! input
704 {| align=right border=1
705 | Cell 1, row 1 
706 |rowspan=2| Cell 2, row 1 (and 2) 
707 | Cell 3, row 1 
708 |- 
709 | Cell 1, row 2 
710 | Cell 3, row 2 
712 !! result
713 <table align=right border=1>
714 <tr >
715 <td> Cell 1, row 1
716 </td><td rowspan=2> Cell 2, row 1 (and 2)
717 </td><td> Cell 3, row 1
718 </td></tr>
719 <tr >
720 <td> Cell 1, row 2
721 </td><td> Cell 3, row 2
722 </td></tr></table>
724 !! end
726 !! test
727 Nested table
728 !! input
729 {| border=1
730 | &alpha;
732 {| bgcolor=#ABCDEF border=2
733 |nested
735 |table
737 |the original table again
739 !! result
740 <table border=1>
741 <tr >
742 <td> &alpha;
743 </td><td>
744 <table bgcolor=#ABCDEF border=2>
745 <tr >
746 <td>nested
747 </td></tr>
748 <tr >
749 <td>table
750 </td></tr></table>
751 </td><td>the original table again
752 </td></tr></table>
754 !! end
757 ### Internal links
759 !! test
760 Plain link, capitalized
761 !! input
762 [[Main Page]]
763 !! result
764 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
765 </p>
766 !! end
768 !! test
769 Plain link, uncapitalized
770 !! input
771 [[main Page]]
772 !! result
773 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
774 </p>
775 !! end
777 !! test
778 Piped link
779 !! input
780 [[Main Page|The Main Page]]
781 !! result
782 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
783 </p>
784 !! end
786 !! test
787 Broken link
788 !! input
789 [[Zigzagzogzagzig]]
790 !! result
791 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
792 </p>
793 !! end
795 !! test
796 Link with prefix
797 !! input
798 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
799 !! result
800 <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>
801 </p>
802 !! end
804 !! test
805 Link with suffix
806 !! input
807 [[Main Page]]xxx, [[Main Page]]XXX
808 !! result
809 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
810 </p>
811 !! end
813 !! test
814 Link with 3 brackets
815 !! input
816 [[[main page]]]
817 !! result
818 <p>[[[main page]]]
819 </p>
820 !! end
822 !! test
823 Piped link with 3 brackets
824 !! input
825 [[[main page|the main page]]]
826 !! result
827 <p>[[[main page|the main page]]]
828 </p>
829 !! end
831 !! test
832 Link to namespaces
833 !! input
834 [[Talk:Parser testing]], [[Meta:Disclaimers]]
835 !! result
836 <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>
837 </p>
838 !! end
840 !! test
841 Piped link to namespace
842 !! input
843 [[Meta:Disclaimers|The disclaimers]]
844 !! result
845 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
846 </p>
847 !! end
849 !! test
850 Link containing }
851 !! input
852 [[Usually caused by a typo (oops}]]
853 !! result
854 <p>[[Usually caused by a typo (oops}]]
855 </p>
856 !! end
858 !! test
859 Link containing % (not as a hex sequence)
860 !! input
861 [[7% Solution]]
862 !! result
863 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
864 </p>
865 !! end
867 !! test
868 Link containing % as a single hex sequence interpreted to char
869 !! input
870 [[7%25 Solution]]
871 !! result
872 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
873 </p>
874 !!end
876 !! test
877 Link containing % as a double hex sequence interpreted to hex sequence
878 !! input
879 [[7%2525 Solution]]
880 !! result
881 <p>[[7%2525 Solution]]
882 </p>
883 !!end
885 !! test
886 Plain link to URL
887 !! input
888 [[http://www.example.org]]
889 !! result
890 <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>]
891 </p>
892 !! end
894 # I'm fairly sure the expected result here is wrong.
895 # We want these to be URL links, not pseudo-pages with URLs for titles....
896 # However the current output is also pretty screwy.
898 # ----
899 # I'm changing it to match the current output--it arguably makes more
900 # sense in the light of the test above. Old expected result was:
901 #<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>
902 #</p>
903 # But I think this test is bordering on "garbage in, garbage out" anyway.
904 # -- wtm
905 !! test
906 Piped link to URL
907 !! input
908 Piped link to URL: [[http://www.example.org|an example URL]]
909 !! result
910 <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>]
911 </p>
912 !! end
914 !! test
915 BUG 2: [[page|http://url/]] should link to page, not http://url/
916 !! input
917 [[Main Page|http://url/]]
918 !! result
919 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
920 </p>
921 !! end
923 !! test
924 BUG 337: Escaped self-links should be bold
925 !! options
926 title=[[Bug462]]
927 !! input
928 [[Bu&#103;462]] [[Bug462]]
929 !! result
930 <p><strong>Bu&#103;462</strong> <strong>Bug462</strong>
931 </p>
932 !! end
934 !! test
935 Self-link to section should not be bold
936 !! options
937 title=[[Main Page]]
938 !! input
939 [[Main Page#section]]
940 !! result
941 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
942 </p>
943 !! end
945 !! test
946 <nowiki> inside a link
947 !! input
948 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
949 !! result
950 <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>
951 </p>
952 !! end
955 ### Interwiki links
958 !! test
959 Inline interwiki link
960 !! input
961 [[MeatBall:SoftSecurity]]
962 !! result
963 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class='extiw'>MeatBall:SoftSecurity</a>
964 </p>
965 !! end
968 ## XHTML tidiness
971 !! test
972 <br> to <br />
973 !! input
974 1<br>2<br />3
975 !! result
976 <p>1<br />2<br />3
977 </p>
978 !! end
981 ### Block-level elements
983 !! test
984 Common list
985 !! input
986 *Common list
987 * item 2
988 *item 3
989 !! result
990 <ul><li>Common list
991 </li><li> item 2
992 </li><li>item 3
993 </li></ul>
995 !! end
997 !! test
998 Numbered list
999 !! input
1000 #Numbered list
1001 #item 2
1002 # item 3
1003 !! result
1004 <ol><li>Numbered list
1005 </li><li>item 2
1006 </li><li> item 3
1007 </li></ol>
1009 !! end
1011 !! test
1012 Mixed list
1013 !! input
1014 *Mixed list
1015 *# with numbers
1016 ** and bullets
1017 *# and numbers
1018 *bullets again
1019 **bullet level 2
1020 ***bullet level 3
1021 ***#Number on level 4
1022 **bullet level 2
1023 **#Number on level 3
1024 **#Number on level 3
1025 *#number level 2
1026 *Level 1
1027 !! result
1028 <ul><li>Mixed list
1029 <ol><li> with numbers
1030 </li></ol>
1031 <ul><li> and bullets
1032 </li></ul>
1033 <ol><li> and numbers
1034 </li></ol>
1035 </li><li>bullets again
1036 <ul><li>bullet level 2
1037 <ul><li>bullet level 3
1038 <ol><li>Number on level 4
1039 </li></ol>
1040 </li></ul>
1041 </li><li>bullet level 2
1042 <ol><li>Number on level 3
1043 </li><li>Number on level 3
1044 </li></ol>
1045 </li></ul>
1046 <ol><li>number level 2
1047 </li></ol>
1048 </li><li>Level 1
1049 </li></ul>
1051 !! end
1054 ### Magic variables
1056 !! test
1057 Magic variables
1058 !! input
1059 {{SITENAME}}
1060 !! result
1061 <p>MediaWiki
1062 </p>
1063 !! end
1066 ### Magic links
1068 !! test
1069 Magic links: internal link to RFC
1070 !! input
1071 [[RFC 123]]
1072 !! result
1073 <p><a href="/index.php?title=RFC_123&amp;action=edit" class="new" title="RFC 123">RFC 123</a>
1074 </p>
1075 !! end
1077 !! test
1078 Magic links: RFC
1079 !! input
1080 RFC 822
1081 !! result
1082 <p><a href='http://www.faqs.org/rfcs/rfc822.html' class='external' title="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>
1083 </p>
1084 !! end
1086 !! test
1087 Magic links: ISBN
1088 !! input
1089 ISBN 0-306-40615-2
1090 !! result
1091 <p><a href="/index.php?title=Special:Booksources&amp;isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1092 </p>
1093 !! end
1096 ### Templates
1097 ####
1099 !! test
1100 Nonexistant template
1101 !! input
1102 {{thistemplatedoesnotexist}}
1103 !! result
1104 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1105 </p>
1106 !! end
1108 !! article
1109 Template:test
1110 !! text
1111 This is a test template
1112 !! endarticle
1114 !! test
1115 Simple template
1116 !! input
1117 {{test}}
1118 !! result
1119 <p>This is a test template
1120 </p>
1121 !! end
1123 !! test
1124 Template with explicit namespace
1125 !! input
1126 {{Template:test}}
1127 !! result
1128 <p>This is a test template
1129 </p>
1130 !! end
1133 !! article
1134 Template:paramtest
1135 !! text
1136 This is a test template with parameter {{{param}}}
1137 !! endarticle
1139 !! test
1140 Template parameter
1141 !! input
1142 {{paramtest|param=foo}}
1143 !! result
1144 <p>This is a test template with parameter foo
1145 </p>
1146 !! end
1148 !! article
1149 Template:paramtestnum
1150 !! text
1151 [[{{{1}}}|{{{2}}}]]
1152 !! endarticle
1154 !! test
1155 Template unnamed parameter
1156 !! input
1157 {{paramtestnum|Main Page|the main page}}
1158 !! result
1159 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
1160 </p>
1161 !! end
1163 !! test
1164 BUG 553: link with two variables in a piped link
1165 !! input
1166 {| 
1167 |[[{{{1}}}|{{{2}}}]]
1169 !! result
1170 <table >
1171 <tr >
1172 <td>[[{{{1}}}|{{{2}}}]]
1173 </td></tr></table>
1175 !! end
1177 !! test
1178 Magic variable as template parameter
1179 !! input
1180 {{paramtest|param={{SITENAME}}}}
1181 !! result
1182 <p>This is a test template with parameter MediaWiki
1183 </p>
1184 !! end
1186 !! article
1187 Template:linktest
1188 !! text
1189 [[{{{param}}}|link]]
1190 !! endarticle
1192 !! test
1193 Template parameter as link source
1194 !! input
1195 {{linktest|param=Main Page}}
1196 !! result
1197 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
1198 </p>
1199 !! end
1202 !!article
1203 Template:paramtest2
1204 !! text
1205 including another template, {{paramtest|param={{{arg}}}}}
1206 !! endarticle
1208 !! test
1209 Template passing argument to another template
1210 !! input
1211 {{paramtest2|arg='hmm'}}
1212 !! result
1213 <p>including another template, This is a test template with parameter 'hmm'
1214 </p>
1215 !! end
1217 !! article
1218 Template:Linktest2
1219 !! text
1220 Main Page
1221 !! endarticle
1223 !! test
1224 Template as link source
1225 !! input
1226 [[{{linktest2}}]]
1227 !! result
1228 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1229 </p>
1230 !! end
1233 !! article
1234 Template:loop1
1235 !! text
1236 {{loop2}}
1237 !! endarticle
1239 !! article
1240 Template:loop2
1241 !! text
1242 {{loop1}}
1243 !! endarticle
1245 !! test
1246 Template infinite loop
1247 !! input
1248 {{loop1}}
1249 !! result
1250 <p>{{loop2}}<!-- WARNING: template loop detected -->
1251 </p>
1252 !! end
1254 !! test
1255 Template from main namespace
1256 !! input
1257 {{:Main Page}}
1258 !! result
1259 <p>blah blah
1260 </p>
1261 !! end
1263 !! article
1264 Template:table
1265 !! text
1266 {| 
1267 | 1 || 2
1268 |- 
1269 | 3 || 4
1271 !! endarticle
1273 !! test
1274 BUG 529: Template with table, not included at beginning of line
1275 !! input
1276 foo {{table}}
1277 !! result
1278 <p>foo 
1279 </p>
1280 <table >
1281 <tr >
1282 <td> 1 </td><td> 2
1283 </td></tr>
1284 <tr >
1285 <td> 3 </td><td> 4
1286 </td></tr></table>
1288 !! end
1290 !! test
1291 BUG 523: Template shouldn't eat newline (or add an extra one before table)
1292 !! input
1294 {{table}}
1295 !! result
1296 <p>foo
1297 </p>
1298 <table >
1299 <tr >
1300 <td> 1 </td><td> 2
1301 </td></tr>
1302 <tr >
1303 <td> 3 </td><td> 4
1304 </td></tr></table>
1306 !! end
1308 !! test
1309 BUG 41: Template parameters shown as broken links
1310 !! input
1311 {{{parameter}}}
1312 !! result
1313 <p>{{{parameter}}}
1314 </p>
1315 !! end
1318 !! article
1319 Template:MSGNW test
1320 !! text
1321 ''None'' of '''this''' should be 
1322 * interepreted
1323  but rather passed unmodified
1324 {{test}}
1325 !! endarticle
1327 # hmm, fix this or just deprecate msgnw and document its behavior?
1328 !! test
1329 msgnw keyword
1330 !! options
1331 disabled
1332 !! input
1333 {{msgnw:MSGNW test}}
1334 !! result
1335 <p>''None'' of '''this''' should be 
1336 * interepreted
1337  but rather passed unmodified
1338 {{test}}
1339 </p>
1340 !! end
1342 !! test
1343 int keyword
1344 !! input
1345 {{int:newmessages|lots of money}}
1346 !! result
1347 <p>You have lots of money.
1348 </p>
1349 !! end
1352 ### Pre-save transform tests
1354 !! test
1355 pre-save transform: subst:
1356 !! options
1358 !! input
1359 {{subst:test}}
1360 !! result
1361 This is a test template
1362 !! end
1364 !! test
1365 pre-save transform: normal template
1366 !! options
1368 !! input
1369 {{test}}
1370 !! result
1371 {{test}}
1372 !! end
1374 !! test
1375 pre-save transform: nonexistant template
1376 !! options
1378 !! input
1379 {{thistemplatedoesnotexist}}
1380 !! result
1381 {{thistemplatedoesnotexist}}
1382 !! end
1385 !! test
1386 pre-save transform: subst magic variables
1387 !! options
1389 !! input
1390 {{subst:SITENAME}}
1391 !! result
1392 MediaWiki
1393 !! end
1395 # This is bug 89, which I fixed. -- wtm
1396 !! test
1397 pre-save transform: subst: templates with parameters
1398 !! options
1400 !! input
1401 {{subst:paramtest|param="something else"}}
1402 !! result
1403 This is a test template with parameter "something else"
1404 !! end
1407 ### Message transform tests
1409 !! test
1410 message transform: magic variables
1411 !! options
1413 !! input
1414 {{SITENAME}}
1415 !! result
1416 MediaWiki
1417 !! end
1419 !! test
1420 message transform: should not transform wiki markup
1421 !! options
1423 !! input
1424 ''test''
1425 !! result
1426 ''test''
1427 !! end
1430 ### Images
1432 !! test
1433 Simple image
1434 !! input
1435 [[Image:foobar.jpg]]
1436 !! result
1437 <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>
1438 </p>
1439 !! end
1441 !! test
1442 Right-aligned image
1443 !! input
1444 [[Image:foobar.jpg|right]]
1445 !! result
1446 <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>
1448 !! end
1450 !! test
1451 Image with caption
1452 !! input
1453 [[Image:foobar.jpg|right|Caption text]]
1454 !! result
1455 <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>
1457 !! end
1459 !! test
1460 Image with frame and link
1461 !! input
1462 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
1463 !! result
1464 <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>
1466 !! end
1468 !! test
1469 Link to image page
1470 !! input
1471 [[:Image:test]]
1472 !! result
1473 <p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
1474 </p>
1475 !! end
1477 !! test
1478 Frameless image caption with a free URL
1479 !! input
1480 [[Image:foobar.jpg|http://example.com]]
1481 !! result
1482 <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>
1483 </p>
1484 !! end
1486 !! test
1487 Thumbnail image caption with a free URL
1488 !! input
1489 [[Image:foobar.jpg|thumb|http://example.com]]
1490 !! result
1491 <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>
1493 !! end
1495 # Pending resolution to bug 368
1496 !! test
1497 BUG 648: Frameless image caption with a link
1498 !! input
1499 [[Image:foobar.jpg|text with a [[link]] in it]]
1500 !! result
1501 <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>
1502 </p>
1503 !! end
1505 !! test
1506 Escape HTML special chars in image alt text
1507 !! input
1508 [[Image:foobar.jpg|& < > "]]
1509 !! result
1510 <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>
1511 </p>
1512 !! end
1514 !! test
1515 BUG 499: Alt text should have &#1234;, not &amp;1234;
1516 !! input
1517 [[Image:foobar.jpg|&#9792;]]
1518 !! result
1519 <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>
1520 </p>
1521 !! end
1523 !! test
1524 Broken image caption with link
1525 !! input
1526 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
1527 !! result
1528 <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.
1529 </p>
1530 !! end
1532 !! test
1533 Image caption containing another image
1534 !! input
1535 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
1536 !! result
1537 <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>
1539 !! end
1542 ### Subpages
1544 !! article
1545 Subpage test/subpage
1546 !! text
1548 !! endarticle
1550 !! test
1551 Subpage link
1552 !! options
1553 subpage title=[[Subpage test]]
1554 !! input
1555 [[/subpage]]
1556 !! result
1557 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
1558 </p>
1559 !! end
1561 !! test
1562 Subpage noslash link
1563 !! options
1564 subpage title=[[Subpage test]]
1565 !!input
1566 [[/subpage/]]
1567 !! result
1568 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
1569 </p>
1570 !! end
1572 !! test
1573 Disabled subpages
1574 !! input
1575 [[/subpage]]
1576 !! result
1577 <p><a href="/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
1578 </p>
1579 !! end
1581 !! test
1582 BUG 561: {{/Subpage}}
1583 !! options
1584 subpage title=[[Page]]
1585 !! input
1586 {{/Subpage}}
1587 !! result
1588 <p><a href="/index.php?title=Page/Subpage&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
1589 </p>
1590 !! end
1593 ### Categories
1595 !! article
1596 Category:MediaWiki User's Guide
1597 !! text
1598 blah
1599 !! endarticle
1601 !! test
1602 Link to category
1603 !! input
1604 [[:Category:MediaWiki User's Guide]]
1605 !! result
1606 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
1607 </p>
1608 !! end
1610 !! test
1611 Simple category
1612 !! options
1614 !! input
1615 [[Category: MediaWiki User's Guide]]
1616 !! result
1617 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
1618 !! end
1621 ### Inter-language links
1623 !! test
1624 Inter-language links
1625 !! options
1627 !! input
1628 [[es:Alimento]]
1629 [[fr:Nourriture]]
1630 [[zh:&#39135;&#21697;]]
1631 !! result
1632 es:Alimento fr:Nourriture zh:食品
1633 !! end
1636 ### Sections
1638 !! test
1639 Basic section headings
1640 !! options
1641 title=[[Parser test script]]
1642 !! input
1643 == Headline 1 ==
1644 Some text
1646 ==Headline 2==
1647 More
1648 ===Smaller headline===
1649 Blah blah
1650 !! result
1651 <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>
1652 <p>Some text
1653 </p>
1654 <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>
1655 <p>More
1656 </p>
1657 <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>
1658 <p>Blah blah
1659 </p>
1660 !! end
1662 !! test
1663 Section headings with TOC
1664 !! options
1665 title=[[Parser test script]]
1666 !! input
1667 == Headline 1 ==
1668 === Subheadline 1 ===
1669 ===== Skipping a level =====
1670 ====== Skipping a level ======
1672 == Headline 2 ==
1673 Some text
1674 ===Another headline===
1675 !! result
1676 <table border="0" id="toc"><tr id="toctitle"><td align="center">
1677 <b>Table of contents</b> <script type="text/javascript">showTocToggle("show","hide")</script></td></tr><tr id="tocinside"><td>
1678 <div class="tocline"><a href="#Headline_1">1 Headline 1</a><br /></div>
1679 <div class="tocindent">
1680 <p><a href="#Subheadline_1">1.1 Subheadline 1</a><br />
1681 </p>
1682 <div class="tocindent">
1683 <div class="tocindent">
1684 <p><a href="#Skipping_a_level">1.1.1 Skipping a level</a><br />
1685 </p>
1686 <div class="tocindent">
1687 <p><a href="#Skipping_a_level_2">1.1.1.1 Skipping a level</a><br />
1688 </p>
1689 </div>
1690 </div>
1691 </div>
1692 </div>
1693 <div class="tocline"><a href="#Headline_2">2 Headline 2</a><br /></div>
1694 <div class="tocindent">
1695 <p><a href="#Another_headline">2.1 Another headline</a><br />
1696 </p>
1697 </div>
1698 </td></tr></table>
1699 <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>
1700 <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>
1701 <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>
1702 <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>
1703 <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>
1704 <p>Some text
1705 </p>
1706 <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>
1708 !! end
1710 !! test
1711 Resolving duplicate section names
1712 !! options
1713 title=[[Parser test script]]
1714 !! input
1715 == Foo bar ==
1716 ==Foo bar==
1717 !! result
1718 <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>
1719 <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>
1721 !! end
1723 !! article
1724 Template:sections
1725 !! text
1726 ===Section 1===
1727 ==Section 2==
1728 !! endarticle
1730 !! test
1731 Template with sections, __NOTOC__
1732 !! options
1733 title=[[Parser test script]]
1734 !! input
1735 __NOTOC__
1736 ==Section 0==
1737 {{sections}}
1738 ==Section 4==
1739 !! result
1740 <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>
1741 <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>
1742 <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>
1743 <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>
1745 !! end
1747 !! test
1748 __NOEDITSECTION__ keyword
1749 !! input
1750 __NOEDITSECTION__
1751 ==Section 1==
1752 ==Section 2==
1753 !! result
1754 <a name="Section_1"></a><h2>Section 1</h2>
1755 <a name="Section_2"></a><h2>Section 2</h2>
1757 !! end
1759 !! test
1760 Link inside a section heading
1761 !! options
1762 title=[[Parser test script]]
1763 !! input
1764 ==Section with a [[Main Page|link]] in it==
1765 !! result
1766 <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>
1768 !! end
1770 TODO:
1771 more images
1772 more tables
1773 math
1774 character entities
1775 and much more