Add more test cases for bug 289
[lhc/web/wiklou.git] / maintenance / parserTests.txt
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 #
5 # The syntax should be fairly self-explanatory.
6 #
7 # Currently supported test options:
8 # One of the following three:
9 #
10 # (default) generate HTML output
11 # pst apply pre-save transform
12 # msg apply message transform
13 #
14 # Plus any combination of these:
15 #
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
21 #
22 # For testing purposes, temporary articles can created:
23 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
24 # where '/' denotes a newline.
25
26 # This is the standard article assumed to exist.
27 !! article
28 Main Page
29 !! text
30 blah blah
31 !! endarticle
32
33 ###
34 ### Basic tests
35 ###
36 !! test
37 Blank input
38 !! input
39 !! result
40 !! end
41
42
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
51
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>
61
62 !! end
63
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>
97
98 !! end
99
100 ###
101 ### <nowiki> test cases
102 ###
103
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
112
113 !! test
114 <nowiki> spacing
115 !! input
116 <nowiki>Lorem ipsum dolor
117
118 sed abit.
119 sed nullum.
120
121 :and a colon
122 </nowiki>
123 !! result
124 <p>Lorem ipsum dolor
125
126 sed abit.
127 sed nullum.
128
129 :and a colon
130
131 </p>
132 !! end
133
134 !! test
135 nowiki 3
136 !! input
137 :There is not nowiki.
138 :There is <nowiki>nowiki</nowiki>.
139
140 #There is not nowiki.
141 #There is <nowiki>nowiki</nowiki>.
142
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>
155
156 !! end
157
158 ###
159 ### comment test cases
160 ###
161 !! test
162 Comment test 1
163 !! input
164 <!-- comment 1 --> asdf
165 <!-- comment 2 -->
166 !! result
167 <pre>asdf
168 </pre>
169
170 !! end
171
172 !! test
173 Comment test 2
174 !! input
175 asdf
176 <!-- comment 1 -->
177 jkl
178 !! result
179 <p>asdf
180 jkl
181 </p>
182 !! end
183
184 !! test
185 Comment test 3
186 !! input
187 asdf
188 <!-- comment 1 -->
189 <!-- comment 2 -->
190 jkl
191 !! result
192 <p>asdf
193 jkl
194 </p>
195 !! end
196
197 !! test
198 Comment test 4
199 !! input
200 asdf<!-- comment 1 -->jkl
201 !! result
202 <p>asdfjkl
203 </p>
204 !! end
205
206 !! test
207 Comment spacing
208 !! input
209 a
210 <!-- foo --> b <!-- bar -->
211 c
212 !! result
213 <p>a
214 </p>
215 <pre> b
216 </pre>
217 <p>c
218 </p>
219 !! end
220
221 ###
222 ### Preformatted text
223 ###
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
240
241 ###
242 ### Definition list
243 ###
244 !! test
245 Simple definition
246 !! input
247 ; name : Definition
248 !! result
249 <dl><dt> name&nbsp;</dt><dd> Definition
250 </dd></dl>
251
252 !! end
253
254 !! test
255 Simple definition
256 !! input
257 : Indented text
258 !! result
259 <dl><dd> Indented text
260 </dd></dl>
261
262 !! end
263
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>
271
272 !!end
273
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>
281
282 !! end
283
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>
291
292 !! end
293
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>
301
302 !! end
303
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>
312
313 !! end
314
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>
322
323 !! end
324
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>
332
333 !! end
334
335
336 ###
337 ### External links
338 ###
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
347
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
356
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
365
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
374
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
383
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
392
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
401
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
410
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
419
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
428
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
437
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
446
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
455
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
464
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
473
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
482
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
491
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
500
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
509
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
518
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
527
528 !! test
529 BUG 289: ">"-token in bracketed URL
530 !! input
531 [http://www.example.com/<hello> stuff]
532 !! result
533 <p>[http://www.example.com/&lt;hello&gt; stuff]
534 </p>
535 !!end
536
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>[http://www.example.com/<b >html</b > stuff]
543 </p>
544 !!end
545
546 ###
547 ### Quotes
548 ###
549
550 !! test
551 Quotes
552 !! input
553 Normal text. '''Bold text.''' Normal text. ''Italic text.''
554
555 Normal text. '''''Bold italic text.''''' Normal text.
556 !!result
557 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
558 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
559 </p>
560 !! end
561
562
563 !! test
564 Unclosed and unmatched quotes
565 !! input
566 '''''Bold italic text '''with bold deactivated''' in between.'''''
567
568 '''''Bold italic text ''with italic deactivated'' in between.'''''
569
570 '''Bold text..
571
572 ..spanning two paragraphs (should not work).'''
573
574 '''Bold tag left open
575
576 ''Italic tag left open
577
578 Normal text.
579
580 <!-- Unmatching number of opening, closing tags: -->
581 '''This year''''s election ''should'' beat '''last year''''s.
582
583 ''Tom'''s car is bigger than ''Susan'''s.
584 !! result
585 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
586 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
587 </p><p><b>Bold text..</b>
588 </p><p>..spanning two paragraphs (should not work).<b></b>
589 </p><p><b>Bold tag left open</b>
590 </p><p><i>Italic tag left open</i>
591 </p><p>Normal text.
592 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
593 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
594 </p>
595 !! end
596
597 ###
598 ### Tables
599 ###
600 ### content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
601 ###
602 !! test
603 Simple table
604 !! input
605 {|
606 | 1 || 2
607 |-
608 | 3 || 4
609 |}
610 !! result
611 <table >
612 <tr >
613 <td> 1 </td><td> 2
614 </td></tr>
615 <tr >
616 <td> 3 </td><td> 4
617 </td></tr></table>
618
619 !! end
620
621 !! test
622 Multiplication table
623 !! input
624 {| border="1" cellpadding="2"
625 |+Multiplication table
626 |-
627 ! &times; !! 1 !! 2 !! 3
628 |-
629 ! 1
630 | 1 || 2 || 3
631 |-
632 ! 2
633 | 2 || 4 || 6
634 |-
635 ! 3
636 | 3 || 6 || 9
637 |-
638 ! 4
639 | 4 || 8 || 12
640 |-
641 ! 5
642 | 5 || 10 || 15
643 |}
644 !! result
645 <table border="1" cellpadding="2">
646 <caption>Multiplication table
647 </caption>
648 <tr >
649 <th> &times; </th><th> 1 </th><th> 2 </th><th> 3
650 </th></tr>
651 <tr >
652 <th> 1
653 </th><td> 1 </td><td> 2 </td><td> 3
654 </td></tr>
655 <tr >
656 <th> 2
657 </th><td> 2 </td><td> 4 </td><td> 6
658 </td></tr>
659 <tr >
660 <th> 3
661 </th><td> 3 </td><td> 6 </td><td> 9
662 </td></tr>
663 <tr >
664 <th> 4
665 </th><td> 4 </td><td> 8 </td><td> 12
666 </td></tr>
667 <tr >
668 <th> 5
669 </th><td> 5 </td><td> 10 </td><td> 15
670 </td></tr></table>
671
672 !! end
673
674 !! test
675 Table rowspan
676 !! input
677 {| align=right border=1
678 | Cell 1, row 1
679 |rowspan=2| Cell 2, row 1 (and 2)
680 | Cell 3, row 1
681 |-
682 | Cell 1, row 2
683 | Cell 3, row 2
684 |}
685 !! result
686 <table align=right border=1>
687 <tr >
688 <td> Cell 1, row 1
689 </td><td rowspan=2> Cell 2, row 1 (and 2)
690 </td><td> Cell 3, row 1
691 </td></tr>
692 <tr >
693 <td> Cell 1, row 2
694 </td><td> Cell 3, row 2
695 </td></tr></table>
696
697 !! end
698
699 !! test
700 Nested table
701 !! input
702 {| border=1
703 | &alpha;
704 |
705 {| bgcolor=#ABCDEF border=2
706 |nested
707 |-
708 |table
709 |}
710 |the original table again
711 |}
712 !! result
713 <table border=1>
714 <tr >
715 <td> &alpha;
716 </td><td>
717 <table bgcolor=#ABCDEF border=2>
718 <tr >
719 <td>nested
720 </td></tr>
721 <tr >
722 <td>table
723 </td></tr></table>
724 </td><td>the original table again
725 </td></tr></table>
726
727 !! end
728
729 ###
730 ### Internal links
731 ###
732 !! test
733 Plain link, capitalized
734 !! input
735 [[Main Page]]
736 !! result
737 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
738 </p>
739 !! end
740
741 !! test
742 Plain link, uncapitalized
743 !! input
744 [[main Page]]
745 !! result
746 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
747 </p>
748 !! end
749
750 !! test
751 Piped link
752 !! input
753 [[Main Page|The Main Page]]
754 !! result
755 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
756 </p>
757 !! end
758
759 !! test
760 Broken link
761 !! input
762 [[Zigzagzogzagzig]]
763 !! result
764 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
765 </p>
766 !! end
767
768 !! test
769 Link with prefix
770 !! input
771 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
772 !! result
773 <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>
774 </p>
775 !! end
776
777 !! test
778 Link with suffix
779 !! input
780 [[Main Page]]xxx, [[Main Page]]XXX
781 !! result
782 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
783 </p>
784 !! end
785
786 !! test
787 Link with 3 brackets
788 !! input
789 [[[main page]]]
790 !! result
791 <p>[[[main page]]]
792 </p>
793 !! end
794
795 !! test
796 Piped link with 3 brackets
797 !! input
798 [[[main page|the main page]]]
799 !! result
800 <p>[[[main page|the main page]]]
801 </p>
802 !! end
803
804 !! test
805 Link to namespaces
806 !! input
807 [[Talk:Parser testing]], [[Meta:Disclaimers]]
808 !! result
809 <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>
810 </p>
811 !! end
812
813 !! test
814 Piped link to namespace
815 !! input
816 [[Meta:Disclaimers|The disclaimers]]
817 !! result
818 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
819 </p>
820 !! end
821
822 !! test
823 Link containing }
824 !! input
825 [[Usually caused by a typo (oops}]]
826 !! result
827 <p>[[Usually caused by a typo (oops}]]
828 </p>
829 !! end
830
831
832 !! test
833 Plain link to URL
834 !! input
835 [[http://www.example.org]]
836 !! result
837 <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>]
838 </p>
839 !! end
840
841 # I'm fairly sure the expected result here is wrong.
842 # We want these to be URL links, not pseudo-pages with URLs for titles....
843 # However the current output is also pretty screwy.
844 #
845 # ----
846 # I'm changing it to match the current output--it arguably makes more
847 # sense in the light of the test above. Old expected result was:
848 #<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>
849 #</p>
850 # But I think this test is bordering on "garbage in, garbage out" anyway.
851 # -- wtm
852 !! test
853 Piped link to URL
854 !! input
855 Piped link to URL: [[http://www.example.org|an example URL]]
856 !! result
857 <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>]
858 </p>
859 !! end
860
861 !! test
862 BUG 2: [[page|http://url/]] should link to page, not http://url/
863 !! input
864 [[Main Page|http://url/]]
865 !! result
866 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
867 </p>
868 !! end
869
870
871 ###
872 ### Interwiki links
873 ###
874
875 !! test
876 Inline interwiki link
877 !! input
878 [[MeatBall:SoftSecurity]]
879 !! result
880 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class='extiw'>MeatBall:SoftSecurity</a>
881 </p>
882 !! end
883
884 ##
885 ## XHTML tidiness
886 ###
887
888 !! test
889 <br> to <br />
890 !! input
891 1<br>2<br />3
892 !! result
893 <p>1<br />2<br />3
894 </p>
895 !! end
896
897 ###
898 ### Block-level elements
899 ###
900 !! test
901 Common list
902 !! input
903 *Common list
904 * item 2
905 *item 3
906 !! result
907 <ul><li>Common list
908 </li><li> item 2
909 </li><li>item 3
910 </li></ul>
911
912 !! end
913
914 !! test
915 Numbered list
916 !! input
917 #Numbered list
918 #item 2
919 # item 3
920 !! result
921 <ol><li>Numbered list
922 </li><li>item 2
923 </li><li> item 3
924 </li></ol>
925
926 !! end
927
928 !! test
929 Mixed list
930 !! input
931 *Mixed list
932 *# with numbers
933 ** and bullets
934 *# and numbers
935 *bullets again
936 **bullet level 2
937 ***bullet level 3
938 ***#Number on level 4
939 **bullet level 2
940 **#Number on level 3
941 **#Number on level 3
942 *#number level 2
943 *Level 1
944 !! result
945 <ul><li>Mixed list
946 <ol><li> with numbers
947 </li></ol>
948 <ul><li> and bullets
949 </li></ul>
950 <ol><li> and numbers
951 </li></ol>
952 </li><li>bullets again
953 <ul><li>bullet level 2
954 <ul><li>bullet level 3
955 <ol><li>Number on level 4
956 </li></ol>
957 </li></ul>
958 </li><li>bullet level 2
959 <ol><li>Number on level 3
960 </li><li>Number on level 3
961 </li></ol>
962 </li></ul>
963 <ol><li>number level 2
964 </li></ol>
965 </li><li>Level 1
966 </li></ul>
967
968 !! end
969
970 ###
971 ### Magic variables
972 ###
973 !! test
974 Magic variables
975 !! input
976 {{SITENAME}}
977 !! result
978 <p>MediaWiki
979 </p>
980 !! end
981
982 ###
983 ### Magic links
984 ###
985 !! test
986 Magic links: internal link to RFC
987 !! input
988 [[RFC 123]]
989 !! result
990 <p><a href="/index.php?title=RFC_123&amp;action=edit" class="new" title="RFC 123">RFC 123</a>
991 </p>
992 !! end
993
994 !! test
995 Magic links: RFC
996 !! input
997 RFC 822
998 !! result
999 <p><a href='http://www.faqs.org/rfcs/rfc822.html' class='external' title="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>
1000 </p>
1001 !! end
1002
1003 !! test
1004 Magic links: ISBN
1005 !! input
1006 ISBN 0-306-40615-2
1007 !! result
1008 <p><a href="/index.php?title=Special:Booksources&amp;isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1009 </p>
1010 !! end
1011
1012 ###
1013 ### Templates
1014 ####
1015
1016 !! test
1017 Nonexistant template
1018 !! input
1019 {{thistemplatedoesnotexist}}
1020 !! result
1021 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1022 </p>
1023 !! end
1024
1025 !! article
1026 Template:test
1027 !! text
1028 This is a test template
1029 !! endarticle
1030
1031 !! test
1032 Simple template
1033 !! input
1034 {{test}}
1035 !! result
1036 <p>This is a test template
1037 </p>
1038 !! end
1039
1040 !! test
1041 Template with explicit namespace
1042 !! input
1043 {{Template:test}}
1044 !! result
1045 <p>This is a test template
1046 </p>
1047 !! end
1048
1049
1050 !! article
1051 Template:paramtest
1052 !! text
1053 This is a test template with parameter {{{param}}}
1054 !! endarticle
1055
1056 !! test
1057 Template parameter
1058 !! input
1059 {{paramtest|param=foo}}
1060 !! result
1061 <p>This is a test template with parameter foo
1062 </p>
1063 !! end
1064
1065 !! article
1066 Template:paramtestnum
1067 !! text
1068 [[{{{1}}}|{{{2}}}]]
1069 !! endarticle
1070
1071 !! test
1072 Template unnamed parameter
1073 !! input
1074 {{paramtestnum|Main Page|the main page}}
1075 !! result
1076 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
1077 </p>
1078 !! end
1079
1080 !! test
1081 BUG 553: link with two variables in a piped link
1082 !! input
1083 {|
1084 |[[{{{1}}}|{{{2}}}]]
1085 |}
1086 !! result
1087 <table >
1088 <tr >
1089 <td>[[{{{1}}}|{{{2}}}]]
1090 </td></tr></table>
1091
1092 !! end
1093
1094 !! test
1095 Magic variable as template parameter
1096 !! input
1097 {{paramtest|param={{SITENAME}}}}
1098 !! result
1099 <p>This is a test template with parameter MediaWiki
1100 </p>
1101 !! end
1102
1103 !! article
1104 Template:linktest
1105 !! text
1106 [[{{{param}}}|link]]
1107 !! endarticle
1108
1109 !! test
1110 Template parameter as link source
1111 !! input
1112 {{linktest|param=Main Page}}
1113 !! result
1114 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
1115 </p>
1116 !! end
1117
1118
1119 !!article
1120 Template:paramtest2
1121 !! text
1122 including another template, {{paramtest|param={{{arg}}}}}
1123 !! endarticle
1124
1125 !! test
1126 Template passing argument to another template
1127 !! input
1128 {{paramtest2|arg='hmm'}}
1129 !! result
1130 <p>including another template, This is a test template with parameter 'hmm'
1131 </p>
1132 !! end
1133
1134 !! article
1135 Template:Linktest2
1136 !! text
1137 Main Page
1138 !! endarticle
1139
1140 !! test
1141 Template as link source
1142 !! input
1143 [[{{linktest2}}]]
1144 !! result
1145 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1146 </p>
1147 !! end
1148
1149
1150 !! article
1151 Template:loop1
1152 !! text
1153 {{loop2}}
1154 !! endarticle
1155
1156 !! article
1157 Template:loop2
1158 !! text
1159 {{loop1}}
1160 !! endarticle
1161
1162 !! test
1163 Template infinite loop
1164 !! input
1165 {{loop1}}
1166 !! result
1167 <p>{{loop2}}<!-- WARNING: template loop detected -->
1168 </p>
1169 !! end
1170
1171 !! test
1172 Template from main namespace
1173 !! input
1174 {{:Main Page}}
1175 !! result
1176 <p>blah blah
1177 </p>
1178 !! end
1179
1180 !! article
1181 Template:table
1182 !! text
1183 {|
1184 | 1 || 2
1185 |-
1186 | 3 || 4
1187 |}
1188 !! endarticle
1189
1190 !! test
1191 BUG 529: Template with table, not included at beginning of line
1192 !! input
1193 foo {{table}}
1194 !! result
1195 <p>foo
1196 </p>
1197 <table >
1198 <tr >
1199 <td> 1 </td><td> 2
1200 </td></tr>
1201 <tr >
1202 <td> 3 </td><td> 4
1203 </td></tr></table>
1204
1205 !! end
1206
1207 !! test
1208 BUG 523: Template shouldn't eat newline (or add an extra one before table)
1209 !! input
1210 foo
1211 {{table}}
1212 !! result
1213 <p>foo
1214 </p>
1215 <table >
1216 <tr >
1217 <td> 1 </td><td> 2
1218 </td></tr>
1219 <tr >
1220 <td> 3 </td><td> 4
1221 </td></tr></table>
1222
1223 !! end
1224
1225 !! test
1226 BUG 41: Template parameters shown as broken links
1227 !! input
1228 {{{parameter}}}
1229 !! result
1230 <p>{{{parameter}}}
1231 </p>
1232 !! end
1233
1234
1235 !! article
1236 Template:MSGNW test
1237 !! text
1238 ''None'' of '''this''' should be
1239 * interepreted
1240 but rather passed unmodified
1241 {{test}}
1242 !! endarticle
1243
1244 # hmm, fix this or just deprecate msgnw and document its behavior?
1245 !! test
1246 msgnw keyword
1247 !! options
1248 disabled
1249 !! input
1250 {{msgnw:MSGNW test}}
1251 !! result
1252 <p>''None'' of '''this''' should be
1253 * interepreted
1254 but rather passed unmodified
1255 {{test}}
1256 </p>
1257 !! end
1258
1259 !! test
1260 int keyword
1261 !! input
1262 {{int:newmessages|lots of money}}
1263 !! result
1264 <p>You have lots of money.
1265 </p>
1266 !! end
1267
1268 ###
1269 ### Pre-save transform tests
1270 ###
1271 !! test
1272 pre-save transform: subst:
1273 !! options
1274 PST
1275 !! input
1276 {{subst:test}}
1277 !! result
1278 This is a test template
1279 !! end
1280
1281 !! test
1282 pre-save transform: normal template
1283 !! options
1284 PST
1285 !! input
1286 {{test}}
1287 !! result
1288 {{test}}
1289 !! end
1290
1291 !! test
1292 pre-save transform: nonexistant template
1293 !! options
1294 PST
1295 !! input
1296 {{thistemplatedoesnotexist}}
1297 !! result
1298 {{thistemplatedoesnotexist}}
1299 !! end
1300
1301
1302 !! test
1303 pre-save transform: subst magic variables
1304 !! options
1305 PST
1306 !! input
1307 {{subst:SITENAME}}
1308 !! result
1309 MediaWiki
1310 !! end
1311
1312 # This is bug 89, which I fixed. -- wtm
1313 !! test
1314 pre-save transform: subst: templates with parameters
1315 !! options
1316 pst
1317 !! input
1318 {{subst:paramtest|param="something else"}}
1319 !! result
1320 This is a test template with parameter "something else"
1321 !! end
1322
1323 ###
1324 ### Message transform tests
1325 ###
1326 !! test
1327 message transform: magic variables
1328 !! options
1329 msg
1330 !! input
1331 {{SITENAME}}
1332 !! result
1333 MediaWiki
1334 !! end
1335
1336 !! test
1337 message transform: should not transform wiki markup
1338 !! options
1339 msg
1340 !! input
1341 ''test''
1342 !! result
1343 ''test''
1344 !! end
1345
1346 ###
1347 ### Images
1348 ###
1349 !! test
1350 Simple image
1351 !! input
1352 [[Image: test]]
1353 !! result
1354 <p><a href="/wiki/Image:Test" class="image" title="Image: test"><img src="/images/0/0c/Test" alt="Image: test" /></a>
1355 </p>
1356 !! end
1357
1358 !! test
1359 Right-aligned image
1360 !! input
1361 [[Image:test|right]]
1362 !! result
1363 <div class="floatright"><span><a href="/wiki/Image:Test" class="image" title="right"><img src="/images/0/0c/Test" alt="right" /></a></span></div>
1364
1365 !! end
1366
1367 !! test
1368 Image with caption
1369 !! input
1370 [[Image:test|right|Caption text]]
1371 !! result
1372 <div class="floatright"><span><a href="/wiki/Image:Test" class="image" title="Caption text"><img src="/images/0/0c/Test" alt="Caption text" /></a></span></div>
1373
1374 !! end
1375
1376 !! test
1377 Image with frame and link
1378 !! input
1379 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
1380 !! result
1381 <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" /></a> <div class="thumbcaption" >This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
1382
1383 !! end
1384
1385 !! test
1386 Link to image page
1387 !! input
1388 [[:Image:test]]
1389 !! result
1390 <p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
1391 </p>
1392 !! end
1393
1394 !! test
1395 Frameless image caption with a free URL
1396 !! input
1397 [[Image:foo|http://example.com]]
1398 !! result
1399 <p><a href="/wiki/Image:Foo" class="image" title="http://example.com"><img src="/images/1/13/Foo" alt="http://example.com" /></a>
1400 </p>
1401 !! end
1402
1403 !! test
1404 Thumbnail image caption with a free URL
1405 !! input
1406 [[Image:foo|thumb|http://example.com]]
1407 !! result
1408 <div class="thumb tright"><div style="width:182px;"><b>Missing image</b><br /><i>Foo</i> <div class="thumbcaption" ><a href="http://example.com" class='external'>http://example.com</a></div></div></div>
1409
1410 !! end
1411
1412 # Pending resolution to bug 368
1413 !! test
1414 BUG 648: Frameless image caption with a link
1415 !! input
1416 [[Image:foo|text with a [[link]] in it]]
1417 !! result
1418 <p><a href="/wiki/Image:Foo" class="image" title="text with a link in it"><img src="/images/1/13/Foo" alt="text with a link in it" /></a>
1419 </p>
1420 !! end
1421
1422 !! test
1423 Escape HTML special chars in image alt text
1424 !! input
1425 [[Image:example.jpg|& < > "]]
1426 !! result
1427 <p><a href="/wiki/Image:Example.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img src="/images/a/a9/Example.jpg" alt="&amp; &lt; &gt; &quot;" /></a>
1428 </p>
1429 !! end
1430
1431 !! test
1432 BUG 499: Alt text should have &#1234;, not &amp;1234;
1433 !! input
1434 [[Image:image.jpg|&#9792;]]
1435 !! result
1436 <p><a href="/wiki/Image:Image.jpg" class="image" title="&#9792;"><img src="/images/7/78/Image.jpg" alt="&#9792;" /></a>
1437 </p>
1438 !! end
1439
1440 !! test
1441 Broken image caption with link
1442 !! input
1443 [[Image:Rowan.jpeg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
1444 !! result
1445 <p>[[Image:Rowan.jpeg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
1446 </p>
1447 !! end
1448
1449 !! test
1450 Image caption containing another image
1451 !! input
1452 [[Image:Bar.jpeg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
1453 !! result
1454 <div class="thumb tright"><div style="width:182px;"><b>Missing image</b><br /><i>Bar.jpeg</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" /></a> inside it!</div></div></div>
1455
1456 !! end
1457
1458 ###
1459 ### Subpages
1460 ###
1461 !! article
1462 Subpage test/subpage
1463 !! text
1464 foo
1465 !! endarticle
1466
1467 !! test
1468 Subpage link
1469 !! options
1470 subpage title=[[Subpage test]]
1471 !! input
1472 [[/subpage]]
1473 !! result
1474 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
1475 </p>
1476 !! end
1477
1478 !! test
1479 Subpage noslash link
1480 !! options
1481 subpage title=[[Subpage test]]
1482 !!input
1483 [[/subpage/]]
1484 !! result
1485 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
1486 </p>
1487 !! end
1488
1489 !! test
1490 Disabled subpages
1491 !! input
1492 [[/subpage]]
1493 !! result
1494 <p><a href="/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
1495 </p>
1496 !! end
1497
1498 !! test
1499 BUG 561: {{/Subpage}}
1500 !! options
1501 subpage title=[[Page]]
1502 !! input
1503 {{/Subpage}}
1504 !! result
1505 <p><a href="/index.php?title=Page/Subpage&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
1506 </p>
1507 !! end
1508
1509 ###
1510 ### Categories
1511 ###
1512 !! article
1513 Category:MediaWiki User's Guide
1514 !! text
1515 blah
1516 !! endarticle
1517
1518 !! test
1519 Link to category
1520 !! input
1521 [[:Category:MediaWiki User's Guide]]
1522 !! result
1523 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
1524 </p>
1525 !! end
1526
1527 !! test
1528 Simple category
1529 !! options
1530 cat
1531 !! input
1532 [[Category: MediaWiki User's Guide]]
1533 !! result
1534 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
1535 !! end
1536
1537 ###
1538 ### Inter-language links
1539 ###
1540 !! test
1541 Inter-language links
1542 !! options
1543 ill
1544 !! input
1545 [[es:Alimento]]
1546 [[fr:Nourriture]]
1547 [[zh:&#39135;&#21697;]]
1548 !! result
1549 es:Alimento fr:Nourriture zh:食品
1550 !! end
1551
1552 ###
1553 ### Sections
1554 ###
1555 !! test
1556 Basic section headings
1557 !! input
1558 == Headline 1 ==
1559 Some text
1560
1561 ==Headline 2==
1562 More
1563 ===Smaller headline===
1564 Blah blah
1565 !! result
1566 <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>
1567 <p>Some text
1568 </p>
1569 <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>
1570 <p>More
1571 </p>
1572 <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>
1573 <p>Blah blah
1574 </p>
1575 !! end
1576
1577 !! test
1578 Section headings with TOC
1579 !! input
1580 == Headline 1 ==
1581 === Subheadline 1 ===
1582 ===== Skipping a level =====
1583 ====== Skipping a level ======
1584
1585 == Headline 2 ==
1586 Some text
1587 ===Another headline===
1588 !! result
1589 <table border="0" id="toc"><tr id="toctitle"><td align="center">
1590 <b>Table of contents</b> <script type="text/javascript">showTocToggle("show","hide")</script></td></tr><tr id="tocinside"><td>
1591 <div class="tocline"><a href="#Headline_1">1 Headline 1</a><br /></div>
1592 <div class="tocindent">
1593 <p><a href="#Subheadline_1">1.1 Subheadline 1</a><br />
1594 </p>
1595 <div class="tocindent">
1596 <div class="tocindent">
1597 <p><a href="#Skipping_a_level">1.1.1 Skipping a level</a><br />
1598 </p>
1599 <div class="tocindent">
1600 <p><a href="#Skipping_a_level_2">1.1.1.1 Skipping a level</a><br />
1601 </p>
1602 </div>
1603 </div>
1604 </div>
1605 </div>
1606 <div class="tocline"><a href="#Headline_2">2 Headline 2</a><br /></div>
1607 <div class="tocindent">
1608 <p><a href="#Another_headline">2.1 Another headline</a><br />
1609 </p>
1610 </div>
1611 </td></tr></table>
1612 <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>
1613 <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>
1614 <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>
1615 <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>
1616 <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>
1617 <p>Some text
1618 </p>
1619 <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>
1620
1621 !! end
1622
1623 !! test
1624 Resolving duplicate section names
1625 !! input
1626 == Foo bar ==
1627 ==Foo bar==
1628 !! result
1629 <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>
1630 <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>
1631
1632 !! end
1633
1634 !! article
1635 Template:sections
1636 !! text
1637 ===Section 1===
1638 ==Section 2==
1639 !! endarticle
1640
1641 !! test
1642 Template with sections, __NOTOC__
1643 !! options title=[[Parser test script]]
1644 !! input
1645 __NOTOC__
1646 ==Section 0==
1647 {{sections}}
1648 ==Section 4==
1649 !! result
1650 <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>
1651 <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>
1652 <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>
1653 <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>
1654
1655 !! end
1656
1657 !! test
1658 __NOEDITSECTION__ keyword
1659 !! input
1660 __NOEDITSECTION__
1661 ==Section 1==
1662 ==Section 2==
1663 !! result
1664 <a name="Section_1"></a><h2>Section 1</h2>
1665 <a name="Section_2"></a><h2>Section 2</h2>
1666
1667 !! end
1668
1669 TODO:
1670 more images
1671 more tables
1672 math
1673 character entities
1674 and much more
1675