Merge "Added several quote tests."
[lhc/web/wiklou.git] / tests / parser / 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 # noxml don't check for XML well formdness
20 # title=[[XXX]] run test using article title XXX
21 # language=XXX set content language to XXX for this test
22 # variant=XXX set the variant of language for this test (eg zh-tw)
23 # disabled do not run test
24 # showtitle make the first line the title
25 # comment run through Linker::formatComment() instead of main parser
26 # local format section links in edit comment text as local links
27 #
28 # For testing purposes, temporary articles can created:
29 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
30 # where '/' denotes a newline.
31
32 # This is the standard article assumed to exist.
33 !! article
34 Main Page
35 !! text
36 blah blah
37 !! endarticle
38
39 !!article
40 Template:Foo
41 !!text
42 FOO
43 !!endarticle
44
45 !! article
46 Template:Blank
47 !! text
48 !! endarticle
49
50 !! article
51 Template:!
52 !! text
53 |
54 !! endarticle
55
56 !!article
57 MediaWiki:bad image list
58 !!text
59 * [[File:Bad.jpg]] except [[Nasty page]]
60 !!endarticle
61
62 !! article
63 Template:inner list
64 !! text
65 * item 1
66 !! endarticle
67
68 ###
69 ### Basic tests
70 ###
71 !! test
72 Blank input
73 !! input
74 !! result
75 !! end
76
77
78 !! test
79 Simple paragraph
80 !! input
81 This is a simple paragraph.
82 !! result
83 <p>This is a simple paragraph.
84 </p>
85 !! end
86
87 !! test
88 Simple list
89 !! input
90 * Item 1
91 * Item 2
92 !! result
93 <ul><li> Item 1
94 </li><li> Item 2
95 </li></ul>
96
97 !! end
98
99 !! test
100 Italics and bold
101 !! input
102 * plain
103 * plain''italic''plain
104 * plain''italic''plain''italic''plain
105 * plain'''bold'''plain
106 * plain'''bold'''plain'''bold'''plain
107 * plain''italic''plain'''bold'''plain
108 * plain'''bold'''plain''italic''plain
109 * plain''italic'''bold-italic'''italic''plain
110 * plain'''bold''bold-italic''bold'''plain
111 * plain'''''bold-italic'''italic''plain
112 * plain'''''bold-italic''bold'''plain
113 * plain''italic'''bold-italic'''''plain
114 * plain'''bold''bold-italic'''''plain
115 * plain l'''italic''plain
116 * plain l''''bold''' plain
117 !! result
118 <ul><li> plain
119 </li><li> plain<i>italic</i>plain
120 </li><li> plain<i>italic</i>plain<i>italic</i>plain
121 </li><li> plain<b>bold</b>plain
122 </li><li> plain<b>bold</b>plain<b>bold</b>plain
123 </li><li> plain<i>italic</i>plain<b>bold</b>plain
124 </li><li> plain<b>bold</b>plain<i>italic</i>plain
125 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
126 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
127 </li><li> plain<i><b>bold-italic</b>italic</i>plain
128 </li><li> plain<b><i>bold-italic</i>bold</b>plain
129 </li><li> plain<i>italic<b>bold-italic</b></i>plain
130 </li><li> plain<b>bold<i>bold-italic</i></b>plain
131 </li><li> plain l'<i>italic</i>plain
132 </li><li> plain l'<b>bold</b> plain
133 </li></ul>
134
135 !! end
136
137 ###
138 ### 2-quote opening sequence tests
139 ###
140 !! test
141 Italics and bold: 2-quote opening sequence: (2,2)
142 !! input
143 ''foo''
144 !! result
145 <p><i>foo</i>
146 </p>
147 !!end
148
149
150 !! test
151 Italics and bold: 2-quote opening sequence: (2,3)
152 !! input
153 ''foo'''
154 !! result
155 <p><i>foo'</i>
156 </p>
157 !!end
158
159
160 !! test
161 Italics and bold: 2-quote opening sequence: (2,4)
162 !! input
163 ''foo''''
164 !! result
165 <p><i>foo''</i>
166 </p>
167 !!end
168
169
170 !! test
171 Italics and bold: 2-quote opening sequence: (2,5)
172 !! input
173 ''foo'''''
174 !! result
175 <p><i>foo</i>
176 </p>
177 !!end
178
179
180 ###
181 ### 3-quote opening sequence tests
182 ###
183
184 !! test
185 Italics and bold: 3-quote opening sequence: (3,2)
186 !! input
187 '''foo''
188 !! result
189 <p>'<i>foo</i>
190 </p>
191 !!end
192
193
194 !! test
195 Italics and bold: 3-quote opening sequence: (3,3)
196 !! input
197 '''foo'''
198 !! result
199 <p><b>foo</b>
200 </p>
201 !!end
202
203
204 !! test
205 Italics and bold: 3-quote opening sequence: (3,4)
206 !! input
207 '''foo''''
208 !! result
209 <p><b>foo'</b>
210 </p>
211 !!end
212
213
214 !! test
215 Italics and bold: 3-quote opening sequence: (3,5)
216 !! input
217 '''foo'''''
218 !! result
219 <p><b>foo</b>
220 </p>
221 !!end
222
223
224 ###
225 ### 4-quote opening sequence tests
226 ###
227
228 !! test
229 Italics and bold: 4-quote opening sequence: (4,2)
230 !! input
231 ''''foo''
232 !! result
233 <p>''<i>foo</i>
234 </p>
235 !!end
236
237
238 !! test
239 Italics and bold: 4-quote opening sequence: (4,3)
240 !! input
241 ''''foo'''
242 !! result
243 <p>'<b>foo</b>
244 </p>
245 !!end
246
247
248 !! test
249 Italics and bold: 4-quote opening sequence: (4,4)
250 !! input
251 ''''foo''''
252 !! result
253 <p>'<b>foo'</b>
254 </p>
255 !!end
256
257
258 !! test
259 Italics and bold: 4-quote opening sequence: (4,5)
260 !! input
261 ''''foo'''''
262 !! result
263 <p>'<b>foo</b>
264 </p>
265 !!end
266
267
268 ###
269 ### 5-quote opening sequence tests
270 ###
271
272 !! test
273 Italics and bold: 5-quote opening sequence: (5,2)
274 !! input
275 '''''foo''
276 !! result
277 <p><b><i>foo</i></b>
278 </p>
279 !!end
280
281
282 !! test
283 Italics and bold: 5-quote opening sequence: (5,3)
284 !! input
285 '''''foo'''
286 !! result
287 <p><i><b>foo</b></i>
288 </p>
289 !!end
290
291
292 !! test
293 Italics and bold: 5-quote opening sequence: (5,4)
294 !! input
295 '''''foo''''
296 !! result
297 <p><i><b>foo'</b></i>
298 </p>
299 !!end
300
301
302 !! test
303 Italics and bold: 5-quote opening sequence: (5,5)
304 !! input
305 '''''foo'''''
306 !! result
307 <p><i><b>foo</b></i>
308 </p>
309 !!end
310
311 ###
312 ### multiple quote sequences in a line
313 ###
314 !! test
315 Italics and bold: multiple quote sequences: (2,4,2)
316 !! input
317 ''foo''''bar''
318 !! result
319 <p><i>foo'<b>bar</b></i>
320 </p>
321 !!end
322
323
324 !! test
325 Italics and bold: multiple quote sequences: (2,4,3)
326 !! input
327 ''foo''''bar'''
328 !! result
329 <p><i>foo'<b>bar</b></i>
330 </p>
331 !!end
332
333
334 !! test
335 Italics and bold: multiple quote sequences: (2,4,4)
336 !! input
337 ''foo''''bar''''
338 !! result
339 <p><i>foo'<b>bar'</b></i>
340 </p>
341 !!end
342
343
344 !! test
345 Italics and bold: multiple quote sequences: (3,4,2)
346 !! input
347 '''foo''''bar''
348 !! result
349 <p><b>foo'</b>bar
350 </p>
351 !!end
352
353
354 !! test
355 Italics and bold: multiple quote sequences: (3,4,3)
356 !! input
357 '''foo''''bar'''
358 !! result
359 <p><b>foo'</b>bar
360 </p>
361 !!end
362
363 ###
364 ### other quote tests
365 ###
366 !! test
367 Italics and bold: other quote tests: (2,3,5)
368 !! input
369 ''this is about '''foo's family'''''
370 !! result
371 <p><i>this is about <b>foo's family</b></i>
372 </p>
373 !!end
374
375
376 !! test
377 Italics and bold: other quote tests: (2,(3,3),2)
378 !! input
379 ''this is about '''foo's''' family''
380 !! result
381 <p><i>this is about <b>foo's</b> family</i>
382 </p>
383 !!end
384
385
386 !! test
387 Italics and bold: other quote tests: (3,2,3,2)
388 !! input
389 '''this is about ''foo'''s family''
390 !! result
391 <p><b>this is about <i>foo</i></b><i>s family</i>
392 </p>
393 !!end
394
395
396 !! test
397 Italics and bold: other quote tests: (3,2,3,3)
398 !! input
399 '''this is about ''foo'''s family'''
400 !! result
401 <p>'<i>this is about </i>foo<b>s family</b>
402 </p>
403 !!end
404
405
406
407 !! test
408 Italics and bold: other quote tests: (3,(2,2),3)
409 !! input
410 '''this is about ''foo's'' family'''
411 !! result
412 <p><b>this is about <i>foo's</i> family</b>
413 </p>
414 !!end
415
416 ###
417 ### <nowiki> test cases
418 ###
419
420 !! test
421 <nowiki> unordered list
422 !! input
423 <nowiki>* This is not an unordered list item.</nowiki>
424 !! result
425 <p>* This is not an unordered list item.
426 </p>
427 !! end
428
429 !! test
430 <nowiki> spacing
431 !! input
432 <nowiki>Lorem ipsum dolor
433
434 sed abit.
435 sed nullum.
436
437 :and a colon
438 </nowiki>
439 !! result
440 <p>Lorem ipsum dolor
441
442 sed abit.
443 sed nullum.
444
445 :and a colon
446
447 </p>
448 !! end
449
450 !! test
451 nowiki 3
452 !! input
453 :There is not nowiki.
454 :There is <nowiki>nowiki</nowiki>.
455
456 #There is not nowiki.
457 #There is <nowiki>nowiki</nowiki>.
458
459 *There is not nowiki.
460 *There is <nowiki>nowiki</nowiki>.
461 !! result
462 <dl><dd>There is not nowiki.
463 </dd><dd>There is nowiki.
464 </dd></dl>
465 <ol><li>There is not nowiki.
466 </li><li>There is nowiki.
467 </li></ol>
468 <ul><li>There is not nowiki.
469 </li><li>There is nowiki.
470 </li></ul>
471
472 !! end
473
474
475 ###
476 ### Comments
477 ###
478 !! test
479 Comment test 1
480 !! input
481 <!-- comment 1 --> asdf
482 <!-- comment 2 -->
483 !! result
484 <pre>asdf
485 </pre>
486
487 !! end
488
489 !! test
490 Comment test 2
491 !! input
492 asdf
493 <!-- comment 1 -->
494 jkl
495 !! result
496 <p>asdf
497 jkl
498 </p>
499 !! end
500
501 !! test
502 Comment test 3
503 !! input
504 asdf
505 <!-- comment 1 -->
506 <!-- comment 2 -->
507 jkl
508 !! result
509 <p>asdf
510 jkl
511 </p>
512 !! end
513
514 !! test
515 Comment test 4
516 !! input
517 asdf<!-- comment 1 -->jkl
518 !! result
519 <p>asdfjkl
520 </p>
521 !! end
522
523 !! test
524 Comment spacing
525 !! input
526 a
527 <!-- foo --> b <!-- bar -->
528 c
529 !! result
530 <p>a
531 </p>
532 <pre> b
533 </pre>
534 <p>c
535 </p>
536 !! end
537
538 !! test
539 Comment whitespace
540 !! input
541 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
542 !! result
543
544 !! end
545
546 !! test
547 Comment semantics and delimiters
548 !! input
549 <!-- --><!----><!-----><!------>
550 !! result
551
552 !! end
553
554 !! test
555 Comment semantics and delimiters, redux
556 !! input
557 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
558 -- foo -- funky huh? ... -->
559 !! result
560
561 !! end
562
563 !! test
564 Comment semantics and delimiters: directors cut
565 !! input
566 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
567 everything starting with < followed by !-- until the first -- and > we see,
568 that wouldn't be valid XML however, since in XML -- has to terminate a comment
569 -->-->
570 !! result
571 <p>--&gt;
572 </p>
573 !! end
574
575 !! test
576 Comment semantics: nesting
577 !! input
578 <!--<!-- no, we're not going to do anything fancy here -->-->
579 !! result
580 <p>--&gt;
581 </p>
582 !! end
583
584 !! test
585 Comment semantics: unclosed comment at end
586 !! input
587 <!--This comment will run out to the end of the document
588 !! result
589
590 !! end
591
592 !! test
593 Comment in template title
594 !! input
595 {{f<!---->oo}}
596 !! result
597 <p>FOO
598 </p>
599 !! end
600
601 !! test
602 Comment on its own line post-expand
603 !! input
604 a
605 {{blank}}<!---->
606 b
607 !! result
608 <p>a
609 </p><p>b
610 </p>
611 !! end
612
613 ###
614 ### Preformatted text
615 ###
616 !! test
617 Preformatted text
618 !! input
619 This is some
620 Preformatted text
621 With ''italic''
622 And '''bold'''
623 And a [[Main Page|link]]
624 !! result
625 <pre>This is some
626 Preformatted text
627 With <i>italic</i>
628 And <b>bold</b>
629 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
630 </pre>
631 !! end
632
633 !! test
634 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
635 !! input
636 <pre><nowiki>
637 <b>
638 <cite>
639 <em>
640 </nowiki></pre>
641 !! result
642 <pre>
643 &lt;b&gt;
644 &lt;cite&gt;
645 &lt;em&gt;
646 </pre>
647
648 !! end
649
650 !! test
651 Regression with preformatted in <center>
652 !! input
653 <center>
654 Blah
655 </center>
656 !! result
657 <center>
658 <pre>Blah
659 </pre>
660 </center>
661
662 !! end
663
664 # Expected output in the following test is not really expected (there should be
665 # <pre> in the output) -- it's only testing for well-formedness.
666 !! test
667 Bug 6200: Preformatted in <blockquote>
668 !! input
669 <blockquote>
670 Blah
671 </blockquote>
672 !! result
673 <blockquote>
674 Blah
675 </blockquote>
676
677 !! end
678
679 !! test
680 <pre> with attributes (bug 3202)
681 !! input
682 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
683 !! result
684 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
685
686 !! end
687
688 !! test
689 <pre> with width attribute (bug 3202)
690 !! input
691 <pre width="8">Narrow screen goodies</pre>
692 !! result
693 <pre width="8">Narrow screen goodies</pre>
694
695 !! end
696
697 !! test
698 <pre> with forbidden attribute (bug 3202)
699 !! input
700 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
701 !! result
702 <pre width="8">Narrow screen goodies</pre>
703
704 !! end
705
706 !! test
707 <pre> with forbidden attribute values (bug 3202)
708 !! input
709 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
710 !! result
711 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
712
713 !! end
714
715 !! test
716 <nowiki> inside <pre> (bug 13238)
717 !! input
718 <pre>
719 <nowiki>
720 </pre>
721 <pre>
722 <nowiki></nowiki>
723 </pre>
724 <pre><nowiki><nowiki></nowiki>Foo<nowiki></nowiki></nowiki></pre>
725 !! result
726 <pre>
727 &lt;nowiki&gt;
728 </pre>
729 <pre>
730
731 </pre>
732 <pre>&lt;nowiki&gt;Foo&lt;/nowiki&gt;</pre>
733
734 !! end
735
736 !! test
737 <nowiki> and <pre> preference (first one wins)
738 !! input
739 <pre>
740 <nowiki>
741 </pre>
742 </nowiki>
743 </pre>
744
745 <nowiki>
746 <pre>
747 <nowiki>
748 </pre>
749 </nowiki>
750 </pre>
751
752 !! result
753 <pre>
754 &lt;nowiki&gt;
755 </pre>
756 <p>&lt;/nowiki&gt;
757 &lt;/pre&gt;
758 </p><p>
759 &lt;pre&gt;
760 &lt;nowiki&gt;
761 &lt;/pre&gt;
762
763 &lt;/pre&gt;
764 </p>
765 !! end
766
767
768 ###
769 ### Definition lists
770 ###
771 !! test
772 Simple definition
773 !! input
774 ; name : Definition
775 !! result
776 <dl><dt> name&#160;</dt><dd> Definition
777 </dd></dl>
778
779 !! end
780
781 !! test
782 Definition list for indentation only
783 !! input
784 : Indented text
785 !! result
786 <dl><dd> Indented text
787 </dd></dl>
788
789 !! end
790
791 !! test
792 Definition list with no space
793 !! input
794 ;name:Definition
795 !! result
796 <dl><dt>name</dt><dd>Definition
797 </dd></dl>
798
799 !!end
800
801 !! test
802 Definition list with URL link
803 !! input
804 ; http://example.com/ : definition
805 !! result
806 <dl><dt> <a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt><dd> definition
807 </dd></dl>
808
809 !! end
810
811 !! test
812 Definition list with bracketed URL link
813 !! input
814 ;[http://www.example.com/ Example]:Something about it
815 !! result
816 <dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt><dd>Something about it
817 </dd></dl>
818
819 !! end
820
821 !! test
822 Definition list with wikilink containing colon
823 !! input
824 ; [[Help:FAQ]]: The least-read page on Wikipedia
825 !! result
826 <dl><dt> <a href="/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt><dd> The least-read page on Wikipedia
827 </dd></dl>
828
829 !! end
830
831 # At Brion's and JeLuF's insistence... :)
832 !! test
833 Definition list with news link containing colon
834 !! input
835 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
836 !! result
837 <dl><dt> <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
838 </dd></dl>
839
840 !! end
841
842 !! test
843 Malformed definition list with colon
844 !! input
845 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
846 !! result
847 <dl><dt> <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
848 </dt></dl>
849
850 !! end
851
852 !! test
853 Definition lists: colon in external link text
854 !! input
855 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
856 !! result
857 <dl><dt> <a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;: The Next Generation</a></dt><dd> OK, I made that up
858 </dd></dl>
859
860 !! end
861
862 !! test
863 Definition lists: colon in HTML attribute
864 !! input
865 ;<b style="display: inline">bold</b>
866 !! result
867 <dl><dt><b style="display: inline">bold</b>
868 </dt></dl>
869
870 !! end
871
872
873 !! test
874 Definition lists: self-closed tag
875 !! input
876 ;one<br/>two : two-line fun
877 !! result
878 <dl><dt>one<br />two&#160;</dt><dd> two-line fun
879 </dd></dl>
880
881 !! end
882
883 !! test
884 Bug 11748: Literal closing tags
885 !! options
886 disabled
887 !! input
888 <dl>
889 <dt>test 1</dt>
890 <dd>test test test test test</dd>
891 <dt>test 2</dt>
892 <dd>test test test test test</dd>
893 </dl>
894 !! result
895 <dl>
896 <dt>test 1</dt>
897 <dd>test test test test test</dd>
898 <dt>test 2</dt>
899 <dd>test test test test test</dd>
900 </dl>
901 !! end
902
903 !! test
904 Definition and unordered list using wiki syntax nested in unordered list using html tags.
905 !! input
906 <ul><li>
907 ; term : description
908 * unordered
909 </li>
910 </ul>
911 !! result
912 <ul><li>
913 <dl><dt> term&#160;</dt><dd> description
914 </dd></dl>
915 <ul><li> unordered
916 </li></ul>
917 </li>
918 </ul>
919
920 !! end
921
922 !! test
923 Definition list with empty definition and following paragraph
924 !! input
925 ; term:
926 Paragraph text
927 !! result
928 <dl><dt> term</dt><dd>
929 </dd></dl>
930 <p>Paragraph text
931 </p>
932 !! end
933
934 ###
935 ### External links
936 ###
937 !! test
938 External links: non-bracketed
939 !! input
940 Non-bracketed: http://example.com
941 !! result
942 <p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
943 </p>
944 !! end
945
946 !! test
947 External links: numbered
948 !! input
949 Numbered: [http://example.com]
950 Numbered: [http://example.net]
951 Numbered: [http://example.com]
952 !! result
953 <p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
954 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
955 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
956 </p>
957 !!end
958
959 !! test
960 External links: specified text
961 !! input
962 Specified text: [http://example.com link]
963 !! result
964 <p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
965 </p>
966 !!end
967
968 !! test
969 External links: trail
970 !! input
971 Linktrails should not work for external links: [http://example.com link]s
972 !! result
973 <p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
974 </p>
975 !! end
976
977 !! test
978 External links: dollar sign in URL
979 !! input
980 http://example.com/1$2345
981 !! result
982 <p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
983 </p>
984 !! end
985
986 !! test
987 External links: dollar sign in URL (named)
988 !! input
989 [http://example.com/1$2345]
990 !! result
991 <p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
992 </p>
993 !!end
994
995 !! test
996 External links: open square bracket forbidden in URL (bug 4377)
997 !! input
998 http://example.com/1[2345
999 !! result
1000 <p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
1001 </p>
1002 !! end
1003
1004 !! test
1005 External links: open square bracket forbidden in URL (named) (bug 4377)
1006 !! input
1007 [http://example.com/1[2345]
1008 !! result
1009 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
1010 </p>
1011 !!end
1012
1013 !! test
1014 External links: nowiki in URL link text (bug 6230)
1015 !!input
1016 [http://example.com/ <nowiki>''example site''</nowiki>]
1017 !! result
1018 <p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
1019 </p>
1020 !! end
1021
1022 !! test
1023 External links: newline forbidden in text (bug 6230 regression check)
1024 !! input
1025 [http://example.com/ first
1026 second]
1027 !! result
1028 <p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
1029 second]
1030 </p>
1031 !!end
1032
1033 !! test
1034 External links: protocol-relative URL in brackets
1035 !! input
1036 [//example.com/ Test]
1037 !! result
1038 <p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
1039 </p>
1040 !! end
1041
1042 !! test
1043 External links: protocol-relative URL in brackets without text
1044 !! input
1045 [//example.com]
1046 !! result
1047 <p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
1048 </p>
1049 !! end
1050
1051 !! test
1052 External links: protocol-relative URL in free text is left alone
1053 !! input
1054 //example.com/Foo
1055 !! result
1056 <p>//example.com/Foo
1057 </p>
1058 !!end
1059
1060 !! test
1061 External links: protocol-relative URL in the middle of a word is left alone (bug 30269)
1062 !! input
1063 foo//example.com/Foo
1064 !! result
1065 <p>foo//example.com/Foo
1066 </p>
1067 !! end
1068
1069 !! test
1070 External image
1071 !! input
1072 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
1073 !! result
1074 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
1075 </p>
1076 !! end
1077
1078 !! test
1079 External image from https
1080 !! input
1081 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
1082 !! result
1083 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
1084 </p>
1085 !! end
1086
1087 !! test
1088 Link to non-http image, no img tag
1089 !! input
1090 Link to non-http image, no img tag: ftp://example.com/test.jpg
1091 !! result
1092 <p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
1093 </p>
1094 !! end
1095
1096 !! test
1097 External links: terminating separator
1098 !! input
1099 Terminating separator: http://example.com/thing,
1100 !! result
1101 <p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
1102 </p>
1103 !! end
1104
1105 !! test
1106 External links: intervening separator
1107 !! input
1108 Intervening separator: http://example.com/1,2,3
1109 !! result
1110 <p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
1111 </p>
1112 !! end
1113
1114 !! test
1115 External links: old bug with URL in query
1116 !! input
1117 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
1118 !! result
1119 <p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
1120 </p>
1121 !! end
1122
1123 !! test
1124 External links: old URL-in-URL bug, mixed protocols
1125 !! input
1126 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
1127 !! result
1128 <p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
1129 </p>
1130 !!end
1131
1132 !! test
1133 External links: URL in text
1134 !! input
1135 URL in text: [http://example.com http://example.com]
1136 !! result
1137 <p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
1138 </p>
1139 !! end
1140
1141 !! test
1142 External links: Clickable images
1143 !! input
1144 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
1145 !! result
1146 <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
1147 </p>
1148 !!end
1149
1150 !! test
1151 External links: raw ampersand
1152 !! input
1153 Old &amp; use: http://x&y
1154 !! result
1155 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
1156 </p>
1157 !! end
1158
1159 !! test
1160 External links: encoded ampersand
1161 !! input
1162 Old &amp; use: http://x&amp;y
1163 !! result
1164 <p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
1165 </p>
1166 !! end
1167
1168 !! test
1169 External links: encoded equals (bug 6102)
1170 !! input
1171 http://example.com/?foo&#61;bar
1172 !! result
1173 <p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
1174 </p>
1175 !! end
1176
1177 !! test
1178 External links: [raw ampersand]
1179 !! input
1180 Old &amp; use: [http://x&y]
1181 !! result
1182 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
1183 </p>
1184 !! end
1185
1186 !! test
1187 External links: [encoded ampersand]
1188 !! input
1189 Old &amp; use: [http://x&amp;y]
1190 !! result
1191 <p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
1192 </p>
1193 !! end
1194
1195 !! test
1196 External links: [encoded equals] (bug 6102)
1197 !! input
1198 [http://example.com/?foo&#61;bar]
1199 !! result
1200 <p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
1201 </p>
1202 !! end
1203
1204 !! test
1205 External links: [IDN ignored character reference in hostname; strip it right off]
1206 !! input
1207 [http://e&zwnj;xample.com/]
1208 !! result
1209 <p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
1210 </p>
1211 !! end
1212
1213 !! test
1214 External links: IDN ignored character reference in hostname; strip it right off
1215 !! input
1216 http://e&zwnj;xample.com/
1217 !! result
1218 <p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
1219 </p>
1220 !! end
1221
1222 !! test
1223 External links: www.jpeg.org (bug 554)
1224 !! input
1225 http://www.jpeg.org
1226 !!result
1227 <p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
1228 </p>
1229 !! end
1230
1231 !! test
1232 External links: URL within URL (original bug 2)
1233 !! input
1234 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
1235 !! result
1236 <p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
1237 </p>
1238 !! end
1239
1240 !! test
1241 BUG 361: URL inside bracketed URL
1242 !! input
1243 [http://www.example.com/foo http://www.example.com/bar]
1244 !! result
1245 <p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
1246 </p>
1247 !! end
1248
1249 !! test
1250 BUG 361: URL within URL, not bracketed
1251 !! input
1252 http://www.example.com/foo?=http://www.example.com/bar
1253 !! result
1254 <p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
1255 </p>
1256 !! end
1257
1258 !! test
1259 BUG 289: ">"-token in URL-tail
1260 !! input
1261 http://www.example.com/<hello>
1262 !! result
1263 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
1264 </p>
1265 !!end
1266
1267 !! test
1268 BUG 289: literal ">"-token in URL-tail
1269 !! input
1270 http://www.example.com/<b>html</b>
1271 !! result
1272 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
1273 </p>
1274 !!end
1275
1276 !! test
1277 BUG 289: ">"-token in bracketed URL
1278 !! input
1279 [http://www.example.com/<hello> stuff]
1280 !! result
1281 <p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
1282 </p>
1283 !!end
1284
1285 !! test
1286 BUG 289: literal ">"-token in bracketed URL
1287 !! input
1288 [http://www.example.com/<b>html</b> stuff]
1289 !! result
1290 <p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
1291 </p>
1292 !!end
1293
1294 !! test
1295 BUG 289: literal double quote at end of URL
1296 !! input
1297 http://www.example.com/"hello"
1298 !! result
1299 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
1300 </p>
1301 !!end
1302
1303 !! test
1304 BUG 289: literal double quote in bracketed URL
1305 !! input
1306 [http://www.example.com/"hello" stuff]
1307 !! result
1308 <p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
1309 </p>
1310 !!end
1311
1312 !! test
1313 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
1314 !! input
1315 [http://www.example.com test]
1316 !! result
1317 <p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
1318 </p>
1319 !! end
1320
1321 !! test
1322 External links: wiki links within external link (Bug 3695)
1323 !! input
1324 [http://example.com [[wikilink]] embedded in ext link]
1325 !! result
1326 <p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
1327 </p>
1328 !! end
1329
1330 !! test
1331 BUG 787: Links with one slash after the url protocol are invalid
1332 !! input
1333 http:/example.com
1334
1335 [http:/example.com title]
1336 !! result
1337 <p>http:/example.com
1338 </p><p>[http:/example.com title]
1339 </p>
1340 !! end
1341
1342 !! test
1343 Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
1344 !! input
1345 ''[http://example.com text'']
1346 [http://example.com '''text]'''
1347 ''Something [http://example.com in italic'']
1348 ''Something [http://example.com mixed''''', even bold]'''
1349 '''''Now [http://example.com both''''']
1350 !! result
1351 <p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
1352 <a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
1353 <i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
1354 <i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>mixed</i><b>, even bold</b></a>
1355 <i><b>Now </b></i><a rel="nofollow" class="external text" href="http://example.com"><i><b>both</b></i></a>
1356 </p>
1357 !! end
1358
1359
1360 !! test
1361 Bug 4781: %26 in URL
1362 !! input
1363 http://www.example.com/?title=AT%26T
1364 !! result
1365 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
1366 </p>
1367 !! end
1368
1369 # According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain
1370 # % is actually legal in HTML5. Any change in output would need testing though.
1371 !! test
1372 Bug 4781, 5267: %25 in URL
1373 !! input
1374 http://www.example.com/?title=100%25_Bran
1375 !! result
1376 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=100%25_Bran">http://www.example.com/?title=100%25_Bran</a>
1377 </p>
1378 !! end
1379
1380 !! test
1381 Bug 4781, 5267: %28, %29 in URL
1382 !! input
1383 http://www.example.com/?title=Ben-Hur_%281959_film%29
1384 !! result
1385 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
1386 </p>
1387 !! end
1388
1389
1390 !! test
1391 Bug 4781: %26 in autonumber URL
1392 !! input
1393 [http://www.example.com/?title=AT%26T]
1394 !! result
1395 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=AT%26T">[1]</a>
1396 </p>
1397 !! end
1398
1399 !! test
1400 Bug 4781, 5267: %26 in autonumber URL
1401 !! input
1402 [http://www.example.com/?title=100%25_Bran]
1403 !! result
1404 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=100%25_Bran">[1]</a>
1405 </p>
1406 !! end
1407
1408 !! test
1409 Bug 4781, 5267: %28, %29 in autonumber URL
1410 !! input
1411 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
1412 !! result
1413 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">[1]</a>
1414 </p>
1415 !! end
1416
1417
1418 !! test
1419 Bug 4781: %26 in bracketed URL
1420 !! input
1421 [http://www.example.com/?title=AT%26T link]
1422 !! result
1423 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=AT%26T">link</a>
1424 </p>
1425 !! end
1426
1427 !! test
1428 Bug 4781, 5267: %26 in bracketed URL
1429 !! input
1430 [http://www.example.com/?title=100%25_Bran link]
1431 !! result
1432 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=100%25_Bran">link</a>
1433 </p>
1434 !! end
1435
1436 !! test
1437 Bug 4781, 5267: %28, %29 in bracketed URL
1438 !! input
1439 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
1440 !! result
1441 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">link</a>
1442 </p>
1443 !! end
1444
1445 !! test
1446 External link containing double-single-quotes in text '' (bug 4598 sanity check)
1447 !! input
1448 Some [http://example.com/ pretty ''italics'' and stuff]!
1449 !! result
1450 <p>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty <i>italics</i> and stuff</a>!
1451 </p>
1452 !! end
1453
1454 !! test
1455 External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check)
1456 !! input
1457 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
1458 !! result
1459 <p><i>Some </i><a rel="nofollow" class="external text" href="http://example.com/"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
1460 </p>
1461 !! end
1462
1463 !! test
1464 External link containing double-single-quotes with no space separating the url from text in italics
1465 !! input
1466 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
1467 !! result
1468 <p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
1469 </p>
1470 !! end
1471
1472 !! test
1473 URL-encoding in URL functions (single parameter)
1474 !! input
1475 {{localurl:Some page|amp=&}}
1476 !! result
1477 <p>/index.php?title=Some_page&amp;amp=&amp;
1478 </p>
1479 !! end
1480
1481 !! test
1482 URL-encoding in URL functions (multiple parameters)
1483 !! input
1484 {{localurl:Some page|q=?&amp=&}}
1485 !! result
1486 <p>/index.php?title=Some_page&amp;q=?&amp;amp=&amp;
1487 </p>
1488 !! end
1489
1490 !! test
1491 Brackets in urls
1492 !! input
1493 http://example.com/index.php?foozoid%5B%5D=bar
1494
1495 http://example.com/index.php?foozoid&#x5B;&#x5D;=bar
1496 !! result
1497 <p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
1498 </p><p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
1499 </p>
1500 !! end
1501
1502 !! test
1503 IPv6 urls (bug 21261)
1504 !! options
1505 disabled
1506 !! input
1507 http://[2404:130:0:1000::187:2]/index.php
1508 !! result
1509 <p><a rel="nofollow" class="external free" href="http://[2404:130:0:1000::187:2]/index.php">http://[2404:130:0:1000::187:2]/index.php</a>
1510 </p>
1511 !! end
1512
1513 ###
1514 ### Quotes
1515 ###
1516
1517 !! test
1518 Quotes
1519 !! input
1520 Normal text. '''Bold text.''' Normal text. ''Italic text.''
1521
1522 Normal text. '''''Bold italic text.''''' Normal text.
1523 !!result
1524 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
1525 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
1526 </p>
1527 !! end
1528
1529
1530 !! test
1531 Unclosed and unmatched quotes
1532 !! input
1533 '''''Bold italic text '''with bold deactivated''' in between.'''''
1534
1535 '''''Bold italic text ''with italic deactivated'' in between.'''''
1536
1537 '''Bold text..
1538
1539 ..spanning two paragraphs (should not work).'''
1540
1541 '''Bold tag left open
1542
1543 ''Italic tag left open
1544
1545 Normal text.
1546
1547 <!-- Unmatching number of opening, closing tags: -->
1548 '''This year''''s election ''should'' beat '''last year''''s.
1549
1550 ''Tom'''s car is bigger than ''Susan'''s.
1551
1552 Plain ''italic'''s plain
1553 !! result
1554 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
1555 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
1556 </p><p><b>Bold text..</b>
1557 </p><p>..spanning two paragraphs (should not work).
1558 </p><p><b>Bold tag left open</b>
1559 </p><p><i>Italic tag left open</i>
1560 </p><p>Normal text.
1561 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
1562 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
1563 </p><p>Plain <i>italic'</i>s plain
1564 </p>
1565 !! end
1566
1567 ###
1568 ### Tables
1569 ###
1570 ### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
1571 ###
1572
1573 # This should not produce <table></table> as <table><tr><td></td></tr></table>
1574 # is the bare minimun required by the spec, see:
1575 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
1576 !! test
1577 A table with no data.
1578 !! input
1579 {||}
1580 !! result
1581 !! end
1582
1583 # A table with nothing but a caption is invalid XHTML, we might want to render
1584 # this as <p>caption</p>
1585 !! test
1586 A table with nothing but a caption
1587 !! input
1588 {|
1589 |+ caption
1590 |}
1591 !! result
1592 <table>
1593 <caption> caption
1594 </caption><tr><td></td></tr></table>
1595
1596 !! end
1597
1598 !! test
1599 Simple table
1600 !! input
1601 {|
1602 | 1 || 2
1603 |-
1604 | 3 || 4
1605 |}
1606 !! result
1607 <table>
1608 <tr>
1609 <td> 1 </td>
1610 <td> 2
1611 </td></tr>
1612 <tr>
1613 <td> 3 </td>
1614 <td> 4
1615 </td></tr></table>
1616
1617 !! end
1618
1619 !! test
1620 Multiplication table
1621 !! input
1622 {| border="1" cellpadding="2"
1623 |+Multiplication table
1624 |-
1625 ! &times; !! 1 !! 2 !! 3
1626 |-
1627 ! 1
1628 | 1 || 2 || 3
1629 |-
1630 ! 2
1631 | 2 || 4 || 6
1632 |-
1633 ! 3
1634 | 3 || 6 || 9
1635 |-
1636 ! 4
1637 | 4 || 8 || 12
1638 |-
1639 ! 5
1640 | 5 || 10 || 15
1641 |}
1642 !! result
1643 <table border="1" cellpadding="2">
1644 <caption>Multiplication table
1645 </caption>
1646 <tr>
1647 <th> &#215; </th>
1648 <th> 1 </th>
1649 <th> 2 </th>
1650 <th> 3
1651 </th></tr>
1652 <tr>
1653 <th> 1
1654 </th>
1655 <td> 1 </td>
1656 <td> 2 </td>
1657 <td> 3
1658 </td></tr>
1659 <tr>
1660 <th> 2
1661 </th>
1662 <td> 2 </td>
1663 <td> 4 </td>
1664 <td> 6
1665 </td></tr>
1666 <tr>
1667 <th> 3
1668 </th>
1669 <td> 3 </td>
1670 <td> 6 </td>
1671 <td> 9
1672 </td></tr>
1673 <tr>
1674 <th> 4
1675 </th>
1676 <td> 4 </td>
1677 <td> 8 </td>
1678 <td> 12
1679 </td></tr>
1680 <tr>
1681 <th> 5
1682 </th>
1683 <td> 5 </td>
1684 <td> 10 </td>
1685 <td> 15
1686 </td></tr></table>
1687
1688 !! end
1689
1690 !! test
1691 Table rowspan
1692 !! input
1693 {| border=1
1694 | Cell 1, row 1
1695 |rowspan=2| Cell 2, row 1 (and 2)
1696 | Cell 3, row 1
1697 |-
1698 | Cell 1, row 2
1699 | Cell 3, row 2
1700 |}
1701 !! result
1702 <table border="1">
1703 <tr>
1704 <td> Cell 1, row 1
1705 </td>
1706 <td rowspan="2"> Cell 2, row 1 (and 2)
1707 </td>
1708 <td> Cell 3, row 1
1709 </td></tr>
1710 <tr>
1711 <td> Cell 1, row 2
1712 </td>
1713 <td> Cell 3, row 2
1714 </td></tr></table>
1715
1716 !! end
1717
1718 !! test
1719 Nested table
1720 !! input
1721 {| border=1
1722 | &alpha;
1723 |
1724 {| bgcolor=#ABCDEF border=2
1725 |nested
1726 |-
1727 |table
1728 |}
1729 |the original table again
1730 |}
1731 !! result
1732 <table border="1">
1733 <tr>
1734 <td> &#945;
1735 </td>
1736 <td>
1737 <table bgcolor="#ABCDEF" border="2">
1738 <tr>
1739 <td>nested
1740 </td></tr>
1741 <tr>
1742 <td>table
1743 </td></tr></table>
1744 </td>
1745 <td>the original table again
1746 </td></tr></table>
1747
1748 !! end
1749
1750 !! test
1751 Invalid attributes in table cell (bug 1830)
1752 !! input
1753 {|
1754 |Cell:|broken
1755 |}
1756 !! result
1757 <table>
1758 <tr>
1759 <td>broken
1760 </td></tr></table>
1761
1762 !! end
1763
1764
1765 !! test
1766 Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
1767 !! input
1768 {|
1769 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
1770 !! result
1771 <table>
1772 <tr>
1773 <td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td>
1774 <td>]" onmouseover="alert(document.cookie)"&gt;test
1775 </td>
1776 </tr>
1777 </table>
1778
1779 !! end
1780
1781
1782 !! test
1783 Indented table markup mixed with indented pre content (proposed in bug 6200)
1784 !! input
1785 <table>
1786 <tr>
1787 <td>
1788 Text that should be rendered preformatted
1789 </td>
1790 </tr>
1791 </table>
1792 !! result
1793 <table>
1794 <tr>
1795 <td>
1796 <pre>Text that should be rendered preformatted
1797 </pre>
1798 </td>
1799 </tr>
1800 </table>
1801
1802 !! end
1803
1804
1805 ###
1806 ### Internal links
1807 ###
1808 !! test
1809 Plain link, capitalized
1810 !! input
1811 [[Main Page]]
1812 !! result
1813 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1814 </p>
1815 !! end
1816
1817 !! test
1818 Plain link, uncapitalized
1819 !! input
1820 [[main Page]]
1821 !! result
1822 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
1823 </p>
1824 !! end
1825
1826 !! test
1827 Piped link
1828 !! input
1829 [[Main Page|The Main Page]]
1830 !! result
1831 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
1832 </p>
1833 !! end
1834
1835 !! test
1836 Broken link
1837 !! input
1838 [[Zigzagzogzagzig]]
1839 !! result
1840 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig</a>
1841 </p>
1842 !! end
1843
1844 !! test
1845 Broken link with fragment
1846 !! input
1847 [[Zigzagzogzagzig#zug]]
1848 !! result
1849 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig#zug</a>
1850 </p>
1851 !! end
1852
1853 !! test
1854 Special page link with fragment
1855 !! input
1856 [[Special:Version#anchor]]
1857 !! result
1858 <p><a href="/wiki/Special:Version#anchor" title="Special:Version">Special:Version#anchor</a>
1859 </p>
1860 !! end
1861
1862 !! test
1863 Nonexistent special page link with fragment
1864 !! input
1865 [[Special:ThisNameWillHopefullyNeverBeUsed#anchor]]
1866 !! result
1867 <p><a href="/wiki/Special:ThisNameWillHopefullyNeverBeUsed" class="new" title="Special:ThisNameWillHopefullyNeverBeUsed (page does not exist)">Special:ThisNameWillHopefullyNeverBeUsed#anchor</a>
1868 </p>
1869 !! end
1870
1871 !! test
1872 Link with prefix
1873 !! input
1874 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
1875 !! result
1876 <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>
1877 </p>
1878 !! end
1879
1880 !! test
1881 Link with suffix
1882 !! input
1883 [[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!!
1884 !! result
1885 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>!!!
1886 </p>
1887 !! end
1888
1889 !! test
1890 Link with 3 brackets
1891 !! input
1892 [[[main page]]]
1893 !! result
1894 <p>[[[main page]]]
1895 </p>
1896 !! end
1897
1898 !! test
1899 Piped link with 3 brackets
1900 !! input
1901 [[[main page|the main page]]]
1902 !! result
1903 <p>[[[main page|the main page]]]
1904 </p>
1905 !! end
1906
1907 !! test
1908 Link with multiple pipes
1909 !! input
1910 [[Main Page|The|Main|Page]]
1911 !! result
1912 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
1913 </p>
1914 !! end
1915
1916 !! test
1917 Link to namespaces
1918 !! input
1919 [[Talk:Parser testing]], [[Meta:Disclaimers]]
1920 !! result
1921 <p><a href="/index.php?title=Talk:Parser_testing&amp;action=edit&amp;redlink=1" class="new" title="Talk:Parser testing (page does not exist)">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">Meta:Disclaimers</a>
1922 </p>
1923 !! end
1924
1925 !! test
1926 Piped link to namespace
1927 !! input
1928 [[Meta:Disclaimers|The disclaimers]]
1929 !! result
1930 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">The disclaimers</a>
1931 </p>
1932 !! end
1933
1934 !! test
1935 Link containing }
1936 !! input
1937 [[Usually caused by a typo (oops}]]
1938 !! result
1939 <p>[[Usually caused by a typo (oops}]]
1940 </p>
1941 !! end
1942
1943 !! test
1944 Link containing % (not as a hex sequence)
1945 !! input
1946 [[7% Solution]]
1947 !! result
1948 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
1949 </p>
1950 !! end
1951
1952 !! test
1953 Link containing % as a single hex sequence interpreted to char
1954 !! input
1955 [[7%25 Solution]]
1956 !! result
1957 <p><a href="/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
1958 </p>
1959 !!end
1960
1961 !! test
1962 Link containing % as a double hex sequence interpreted to hex sequence
1963 !! input
1964 [[7%2525 Solution]]
1965 !! result
1966 <p>[[7%2525 Solution]]
1967 </p>
1968 !!end
1969
1970 !! test
1971 Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
1972 Example for such a section: == < ==
1973 !! input
1974 [[%23%3c]][[%23%3e]]
1975 !! result
1976 <p><a href="#.3C">#&lt;</a><a href="#.3E">#&gt;</a>
1977 </p>
1978 !! end
1979
1980 !! test
1981 Link containing "<#" and ">#" as a hex sequences
1982 !! input
1983 [[%3c%23]][[%3e%23]]
1984 !! result
1985 <p>[[%3c%23]][[%3e%23]]
1986 </p>
1987 !! end
1988
1989 !! test
1990 Link containing double-single-quotes '' (bug 4598)
1991 !! input
1992 [[Lista d''e paise d''o munno]]
1993 !! result
1994 <p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
1995 </p>
1996 !! end
1997
1998 !! test
1999 Link containing double-single-quotes '' in text (bug 4598 sanity check)
2000 !! input
2001 Some [[Link|pretty ''italics'' and stuff]]!
2002 !! result
2003 <p>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
2004 </p>
2005 !! end
2006
2007 !! test
2008 Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check)
2009 !! input
2010 ''Some [[Link|pretty ''italics'' and stuff]]!
2011 !! result
2012 <p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
2013 </p>
2014 !! end
2015
2016 !! test
2017 Link with double quotes in title part (literal) and alternate part (interpreted)
2018 !! input
2019 [[File:Denys Savchenko ''Pentecoste''.jpg]]
2020
2021 [[''Pentecoste'']]
2022
2023 [[''Pentecoste''|Pentecoste]]
2024
2025 [[''Pentecoste''|''Pentecoste'']]
2026 !! result
2027 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
2028 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
2029 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
2030 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)"><i>Pentecoste</i></a>
2031 </p>
2032 !! end
2033
2034 !! test
2035 Plain link to URL
2036 !! input
2037 [[http://www.example.com]]
2038 !! result
2039 <p>[<a rel="nofollow" class="external autonumber" href="http://www.example.com">[1]</a>]
2040 </p>
2041 !! end
2042
2043 !! test
2044 Plain link to URL with link text
2045 !! input
2046 [[http://www.example.com Link text]]
2047 !! result
2048 <p>[<a rel="nofollow" class="external text" href="http://www.example.com">Link text</a>]
2049 </p>
2050 !! end
2051
2052 !! test
2053 Plain link to protocol-relative URL
2054 !! input
2055 [[//www.example.com]]
2056 !! result
2057 <p>[<a rel="nofollow" class="external autonumber" href="//www.example.com">[1]</a>]
2058 </p>
2059 !! end
2060
2061 !! test
2062 Plain link to protocol-relative URL with link text
2063 !! input
2064 [[//www.example.com Link text]]
2065 !! result
2066 <p>[<a rel="nofollow" class="external text" href="//www.example.com">Link text</a>]
2067 </p>
2068 !! end
2069
2070
2071 # I'm fairly sure the expected result here is wrong.
2072 # We want these to be URL links, not pseudo-pages with URLs for titles....
2073 # However the current output is also pretty screwy.
2074 #
2075 # ----
2076 # I'm changing it to match the current output--it arguably makes more
2077 # sense in the light of the test above. Old expected result was:
2078 #<p>Piped link to URL: <a href="/index.php?title=Http://www.example.com&amp;action=edit" class="new">an example URL</a>
2079 #</p>
2080 # But I think this test is bordering on "garbage in, garbage out" anyway.
2081 # -- wtm
2082 !! test
2083 Piped link to URL
2084 !! input
2085 Piped link to URL: [[http://www.example.com|an example URL]]
2086 !! result
2087 <p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
2088 </p>
2089 !! end
2090
2091 !! test
2092 BUG 2: [[page|http://url/]] should link to page, not http://url/
2093 !! input
2094 [[Main Page|http://url/]]
2095 !! result
2096 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
2097 </p>
2098 !! end
2099
2100 !! test
2101 BUG 337: Escaped self-links should be bold
2102 !! options
2103 title=[[Bug462]]
2104 !! input
2105 [[Bu&#103;462]] [[Bug462]]
2106 !! result
2107 <p><strong class="selflink">Bu&#103;462</strong> <strong class="selflink">Bug462</strong>
2108 </p>
2109 !! end
2110
2111 !! test
2112 Self-link to section should not be bold
2113 !! options
2114 title=[[Main Page]]
2115 !! input
2116 [[Main Page#section]]
2117 !! result
2118 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
2119 </p>
2120 !! end
2121
2122 !! article
2123 00
2124 !! text
2125 This is 00.
2126 !! endarticle
2127
2128 !!test
2129 Self-link to numeric title
2130 !!options
2131 title=[[0]]
2132 !!input
2133 [[0]]
2134 !!result
2135 <p><strong class="selflink">0</strong>
2136 </p>
2137 !!end
2138
2139 !!test
2140 Link to numeric-equivalent title
2141 !!options
2142 title=[[0]]
2143 !!input
2144 [[00]]
2145 !!result
2146 <p><a href="/wiki/00" title="00">00</a>
2147 </p>
2148 !!end
2149
2150 !! test
2151 <nowiki> inside a link
2152 !! input
2153 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
2154 !! result
2155 <p>[[Main Page]] <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
2156 </p>
2157 !! end
2158
2159 !! test
2160 Non-breaking spaces in title
2161 !! input
2162 [[&nbsp; Main &nbsp; Page &nbsp;]]
2163 !! result
2164 <p><a href="/wiki/Main_Page" title="Main Page">&#160; Main &#160; Page &#160;</a>
2165 </p>
2166 !!end
2167
2168 !! test
2169 Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue)
2170 !! options
2171 language=ca
2172 !! input
2173 '''[[Main Page]]'''
2174 !! result
2175 <p><b><a href="/wiki/Main_Page" title="Main Page">Main Page</a></b>
2176 </p>
2177 !! end
2178
2179 !! test
2180 Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue)
2181 !! options
2182 language=ca
2183 !! input
2184 ''[[Main Page]]''
2185 !! result
2186 <p><i><a href="/wiki/Main_Page" title="Main Page">Main Page</a></i>
2187 </p>
2188 !! end
2189
2190 !! test
2191 Internal link with en linktrail: no apostrophes (bug 27473)
2192 !! options
2193 language=en
2194 !! input
2195 [[Something]]'nice
2196 !! result
2197 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
2198 </p>
2199 !! end
2200
2201 !! test
2202 Internal link with ca linktrail with apostrophes (bug 27473)
2203 !! options
2204 language=ca
2205 !! input
2206 [[Something]]'nice
2207 !! result
2208 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
2209 </p>
2210 !! end
2211
2212 !! test
2213 Internal link with kaa linktrail with apostrophes (bug 27473)
2214 !! options
2215 language=kaa
2216 !! input
2217 [[Something]]'nice
2218 !! result
2219 <p><a href="/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
2220 </p>
2221 !! end
2222
2223 ###
2224 ### Interwiki links (see maintenance/interwiki.sql)
2225 ###
2226
2227 !! test
2228 Inline interwiki link
2229 !! input
2230 [[MeatBall:SoftSecurity]]
2231 !! result
2232 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
2233 </p>
2234 !! end
2235
2236 !! test
2237 Inline interwiki link with empty title (bug 2372)
2238 !! input
2239 [[MeatBall:]]
2240 !! result
2241 <p><a href="http://www.usemod.com/cgi-bin/mb.pl" class="extiw" title="meatball:">MeatBall:</a>
2242 </p>
2243 !! end
2244
2245 !! test
2246 Interwiki link encoding conversion (bug 1636)
2247 !! input
2248 *[[Wikipedia:ro:Olteni&#0355;a]]
2249 *[[Wikipedia:ro:Olteni&#355;a]]
2250 !! result
2251 <ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a>
2252 </li><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a>
2253 </li></ul>
2254
2255 !! end
2256
2257 !! test
2258 Interwiki link with fragment (bug 2130)
2259 !! input
2260 [[MeatBall:SoftSecurity#foo]]
2261 !! result
2262 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
2263 </p>
2264 !! end
2265
2266 !! test
2267 Interlanguage link
2268 !! input
2269 Blah blah blah
2270 [[zh:Chinese]]
2271 !!result
2272 <p>Blah blah blah
2273 </p>
2274 !! end
2275
2276 !! test
2277 Double interlanguage link
2278 !! input
2279 Blah blah blah
2280 [[es:Spanish]]
2281 [[zh:Chinese]]
2282 !!result
2283 <p>Blah blah blah
2284 </p>
2285 !! end
2286
2287 !! test
2288 Interlanguage link, with prefix links
2289 !! options
2290 language=ln
2291 !! input
2292 Blah blah blah
2293 [[zh:Chinese]]
2294 !!result
2295 <p>Blah blah blah
2296 </p>
2297 !! end
2298
2299 !! test
2300 Double interlanguage link, with prefix links (bug 8897)
2301 !! options
2302 language=ln
2303 !! input
2304 Blah blah blah
2305 [[es:Spanish]]
2306 [[zh:Chinese]]
2307 !!result
2308 <p>Blah blah blah
2309 </p>
2310 !! end
2311
2312
2313 ##
2314 ## XHTML tidiness
2315 ###
2316
2317 !! test
2318 <br> to <br />
2319 !! input
2320 1<br>2<br />3
2321 !! result
2322 <p>1<br />2<br />3
2323 </p>
2324 !! end
2325
2326 !! test
2327 Incorrecly removing closing slashes from correctly formed XHTML
2328 !! input
2329 <br style="clear:both;" />
2330 !! result
2331 <p><br style="clear:both;" />
2332 </p>
2333 !! end
2334
2335 !! test
2336 Failing to transform badly formed HTML into correct XHTML
2337 !! input
2338 <br style="clear: left;">
2339 <br style="clear: right;">
2340 <br style="clear: both;">
2341 !! result
2342 <p><br style="clear: left;" />
2343 <br style="clear: right;" />
2344 <br style="clear: both;" />
2345 </p>
2346 !!end
2347
2348 !! test
2349 Horizontal ruler (should it add that extra space?)
2350 !! input
2351 <hr>
2352 <hr >
2353 foo <hr
2354 > bar
2355 !! result
2356 <hr />
2357 <hr />
2358 foo <hr /> bar
2359
2360 !! end
2361
2362 ###
2363 ### Block-level elements
2364 ###
2365 !! test
2366 Common list
2367 !! input
2368 *Common list
2369 * item 2
2370 *item 3
2371 !! result
2372 <ul><li>Common list
2373 </li><li> item 2
2374 </li><li>item 3
2375 </li></ul>
2376
2377 !! end
2378
2379 !! test
2380 Numbered list
2381 !! input
2382 #Numbered list
2383 #item 2
2384 # item 3
2385 !! result
2386 <ol><li>Numbered list
2387 </li><li>item 2
2388 </li><li> item 3
2389 </li></ol>
2390
2391 !! end
2392
2393 !! test
2394 Mixed list
2395 !! input
2396 *Mixed list
2397 *# with numbers
2398 ** and bullets
2399 *# and numbers
2400 *bullets again
2401 **bullet level 2
2402 ***bullet level 3
2403 ***#Number on level 4
2404 **bullet level 2
2405 **#Number on level 3
2406 **#Number on level 3
2407 *#number level 2
2408 *Level 1
2409 *** Level 3
2410 #** Level 3, but ordered
2411 !! result
2412 <ul><li>Mixed list
2413 <ol><li> with numbers
2414 </li></ol>
2415 <ul><li> and bullets
2416 </li></ul>
2417 <ol><li> and numbers
2418 </li></ol>
2419 </li><li>bullets again
2420 <ul><li>bullet level 2
2421 <ul><li>bullet level 3
2422 <ol><li>Number on level 4
2423 </li></ol>
2424 </li></ul>
2425 </li><li>bullet level 2
2426 <ol><li>Number on level 3
2427 </li><li>Number on level 3
2428 </li></ol>
2429 </li></ul>
2430 <ol><li>number level 2
2431 </li></ol>
2432 </li><li>Level 1
2433 <ul><li><ul><li> Level 3
2434 </li></ul>
2435 </li></ul>
2436 </li></ul>
2437 <ol><li><ul><li><ul><li> Level 3, but ordered
2438 </li></ul>
2439 </li></ul>
2440 </li></ol>
2441
2442 !! end
2443
2444 !! test
2445 Nested lists 1
2446 !! input
2447 *foo
2448 **bar
2449 !! result
2450 <ul><li>foo
2451 <ul><li>bar
2452 </li></ul>
2453 </li></ul>
2454
2455 !! end
2456
2457 !! test
2458 Nested lists 2
2459 !! input
2460 **foo
2461 *bar
2462 !! result
2463 <ul><li><ul><li>foo
2464 </li></ul>
2465 </li><li>bar
2466 </li></ul>
2467
2468 !! end
2469
2470 !! test
2471 Nested lists 3 (first element empty)
2472 !! input
2473 *
2474 **bar
2475 !! result
2476 <ul><li>
2477 <ul><li>bar
2478 </li></ul>
2479 </li></ul>
2480
2481 !! end
2482
2483 !! test
2484 Nested lists 4 (first element empty)
2485 !! input
2486 **
2487 *bar
2488 !! result
2489 <ul><li><ul><li>
2490 </li></ul>
2491 </li><li>bar
2492 </li></ul>
2493
2494 !! end
2495
2496 !! test
2497 Nested lists 5 (both elements empty)
2498 !! input
2499 **
2500 *
2501 !! result
2502 <ul><li><ul><li>
2503 </li></ul>
2504 </li><li>
2505 </li></ul>
2506
2507 !! end
2508
2509 !! test
2510 Nested lists 6 (both elements empty)
2511 !! input
2512 *
2513 **
2514 !! result
2515 <ul><li>
2516 <ul><li>
2517 </li></ul>
2518 </li></ul>
2519
2520 !! end
2521
2522 !! test
2523 Nested lists 7 (skip initial nesting levels)
2524 !! input
2525 *** foo
2526 !! result
2527 <ul><li><ul><li><ul><li> foo
2528 </li></ul>
2529 </li></ul>
2530 </li></ul>
2531
2532 !! end
2533
2534 !! test
2535 Nested lists 8 (multiple nesting transitions)
2536 !! input
2537 * foo
2538 *** bar
2539 ** baz
2540 * boo
2541 !! result
2542 <ul><li> foo
2543 <ul><li><ul><li> bar
2544 </li></ul>
2545 </li><li> baz
2546 </li></ul>
2547 </li><li> boo
2548 </li></ul>
2549
2550 !! end
2551
2552
2553 !! test
2554 List items are not parsed correctly following a <pre> block (bug 785)
2555 !! input
2556 * <pre>foo</pre>
2557 * <pre>bar</pre>
2558 * zar
2559 !! result
2560 <ul><li> <pre>foo</pre>
2561 </li><li> <pre>bar</pre>
2562 </li><li> zar
2563 </li></ul>
2564
2565 !! end
2566
2567 !! test
2568 List items from template
2569 !! input
2570
2571 {{inner list}}
2572 * item 2
2573
2574 * item 0
2575 {{inner list}}
2576 * item 2
2577
2578 * item 0
2579 * notSOL{{inner list}}
2580 * item 2
2581 !! result
2582 <ul><li> item 1
2583 </li><li> item 2
2584 </li></ul>
2585 <ul><li> item 0
2586 </li><li> item 1
2587 </li><li> item 2
2588 </li></ul>
2589 <ul><li> item 0
2590 </li><li> notSOL
2591 </li><li> item 1
2592 </li><li> item 2
2593 </li></ul>
2594
2595 !! end
2596
2597 !! test
2598 List interrupted by empty line or heading
2599 !! input
2600 * foo
2601
2602 ** bar
2603 == A heading ==
2604 * Another list item
2605 !! result
2606 <ul><li> foo
2607 </li></ul>
2608 <ul><li><ul><li> bar
2609 </li></ul>
2610 </li></ul>
2611 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: A heading">edit</a>]</span> <span class="mw-headline" id="A_heading"> A heading </span></h2>
2612 <ul><li> Another list item
2613 </li></ul>
2614
2615 !!end
2616
2617
2618 ###
2619 ### Magic Words
2620 ###
2621
2622 !! test
2623 Magic Word: {{CURRENTDAY}}
2624 !! input
2625 {{CURRENTDAY}}
2626 !! result
2627 <p>1
2628 </p>
2629 !! end
2630
2631 !! test
2632 Magic Word: {{CURRENTDAY2}}
2633 !! input
2634 {{CURRENTDAY2}}
2635 !! result
2636 <p>01
2637 </p>
2638 !! end
2639
2640 !! test
2641 Magic Word: {{CURRENTDAYNAME}}
2642 !! input
2643 {{CURRENTDAYNAME}}
2644 !! result
2645 <p>Thursday
2646 </p>
2647 !! end
2648
2649 !! test
2650 Magic Word: {{CURRENTDOW}}
2651 !! input
2652 {{CURRENTDOW}}
2653 !! result
2654 <p>4
2655 </p>
2656 !! end
2657
2658 !! test
2659 Magic Word: {{CURRENTMONTH}}
2660 !! input
2661 {{CURRENTMONTH}}
2662 !! result
2663 <p>01
2664 </p>
2665 !! end
2666
2667 !! test
2668 Magic Word: {{CURRENTMONTHABBREV}}
2669 !! input
2670 {{CURRENTMONTHABBREV}}
2671 !! result
2672 <p>Jan
2673 </p>
2674 !! end
2675
2676 !! test
2677 Magic Word: {{CURRENTMONTHNAME}}
2678 !! input
2679 {{CURRENTMONTHNAME}}
2680 !! result
2681 <p>January
2682 </p>
2683 !! end
2684
2685 !! test
2686 Magic Word: {{CURRENTMONTHNAMEGEN}}
2687 !! input
2688 {{CURRENTMONTHNAMEGEN}}
2689 !! result
2690 <p>January
2691 </p>
2692 !! end
2693
2694 !! test
2695 Magic Word: {{CURRENTTIME}}
2696 !! input
2697 {{CURRENTTIME}}
2698 !! result
2699 <p>00:02
2700 </p>
2701 !! end
2702
2703 !! test
2704 Magic Word: {{CURRENTWEEK}} (@bug 4594)
2705 !! input
2706 {{CURRENTWEEK}}
2707 !! result
2708 <p>1
2709 </p>
2710 !! end
2711
2712 !! test
2713 Magic Word: {{CURRENTYEAR}}
2714 !! input
2715 {{CURRENTYEAR}}
2716 !! result
2717 <p>1970
2718 </p>
2719 !! end
2720
2721 !! test
2722 Magic Word: {{FULLPAGENAME}}
2723 !! options
2724 title=[[User:Ævar Arnfjörð Bjarmason]]
2725 !! input
2726 {{FULLPAGENAME}}
2727 !! result
2728 <p>User:Ævar Arnfjörð Bjarmason
2729 </p>
2730 !! end
2731
2732 !! test
2733 Magic Word: {{FULLPAGENAMEE}}
2734 !! options
2735 title=[[User:Ævar Arnfjörð Bjarmason]]
2736 !! input
2737 {{FULLPAGENAMEE}}
2738 !! result
2739 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
2740 </p>
2741 !! end
2742
2743 !! test
2744 Magic Word: {{NAMESPACE}}
2745 !! options
2746 title=[[User:Ævar Arnfjörð Bjarmason]]
2747 !! input
2748 {{NAMESPACE}}
2749 !! result
2750 <p>User
2751 </p>
2752 !! end
2753
2754 !! test
2755 Magic Word: {{NAMESPACEE}}
2756 !! options
2757 title=[[User:Ævar Arnfjörð Bjarmason]]
2758 !! input
2759 {{NAMESPACEE}}
2760 !! result
2761 <p>User
2762 </p>
2763 !! end
2764
2765 !! test
2766 Magic Word: {{NAMESPACENUMBER}}
2767 !! options
2768 title=[[User:Ævar Arnfjörð Bjarmason]]
2769 !! input
2770 {{NAMESPACENUMBER}}
2771 !! result
2772 <p>2
2773 </p>
2774 !! end
2775
2776 !! test
2777 Magic Word: {{NUMBEROFFILES}}
2778 !! input
2779 {{NUMBEROFFILES}}
2780 !! result
2781 <p>2
2782 </p>
2783 !! end
2784
2785 !! test
2786 Magic Word: {{PAGENAME}}
2787 !! options
2788 title=[[User:Ævar Arnfjörð Bjarmason]]
2789 !! input
2790 {{PAGENAME}}
2791 !! result
2792 <p>Ævar Arnfjörð Bjarmason
2793 </p>
2794 !! end
2795
2796 !! test
2797 Magic Word: {{PAGENAME}} with metacharacters
2798 !! options
2799 title=[['foo & bar = baz']]
2800 !! input
2801 ''{{PAGENAME}}''
2802 !! result
2803 <p><i>&#39;foo &#38; bar &#61; baz&#39;</i>
2804 </p>
2805 !! end
2806
2807 !! test
2808 Magic Word: {{PAGENAME}} with metacharacters (bug 26781)
2809 !! options
2810 title=[[*RFC 1234 http://example.com/]]
2811 !! input
2812 {{PAGENAME}}
2813 !! result
2814 <p>&#42;RFC&#32;1234 http&#58;//example.com/
2815 </p>
2816 !! end
2817
2818 !! test
2819 Magic Word: {{PAGENAMEE}}
2820 !! options
2821 title=[[User:Ævar Arnfjörð Bjarmason]]
2822 !! input
2823 {{PAGENAMEE}}
2824 !! result
2825 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
2826 </p>
2827 !! end
2828
2829 !! test
2830 Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781)
2831 !! options
2832 title=[[*RFC 1234 http://example.com/]]
2833 !! input
2834 {{PAGENAMEE}}
2835 !! result
2836 <p>&#42;RFC_1234_http&#58;//example.com/
2837 </p>
2838 !! end
2839
2840 !! test
2841 Magic Word: {{REVISIONID}}
2842 !! input
2843 {{REVISIONID}}
2844 !! result
2845 <p>1337
2846 </p>
2847 !! end
2848
2849 !! test
2850 Magic Word: {{SCRIPTPATH}}
2851 !! input
2852 {{SCRIPTPATH}}
2853 !! result
2854 <p>/
2855 </p>
2856 !! end
2857
2858 !! test
2859 Magic Word: {{SERVER}}
2860 !! input
2861 {{SERVER}}
2862 !! result
2863 <p><a rel="nofollow" class="external free" href="http://Britney-Spears">http://Britney-Spears</a>
2864 </p>
2865 !! end
2866
2867 !! test
2868 Magic Word: {{SERVERNAME}}
2869 !! input
2870 {{SERVERNAME}}
2871 !! result
2872 <p>Britney-Spears
2873 </p>
2874 !! end
2875
2876 !! test
2877 Magic Word: {{SITENAME}}
2878 !! input
2879 {{SITENAME}}
2880 !! result
2881 <p>MediaWiki
2882 </p>
2883 !! end
2884
2885 !! test
2886 Namespace 1 {{ns:1}}
2887 !! input
2888 {{ns:1}}
2889 !! result
2890 <p>Talk
2891 </p>
2892 !! end
2893
2894 !! test
2895 Namespace 1 {{ns:01}}
2896 !! input
2897 {{ns:01}}
2898 !! result
2899 <p>Talk
2900 </p>
2901 !! end
2902
2903 !! test
2904 Namespace 0 {{ns:0}} (bug 4783)
2905 !! input
2906 {{ns:0}}
2907 !! result
2908
2909 !! end
2910
2911 !! test
2912 Namespace 0 {{ns:00}} (bug 4783)
2913 !! input
2914 {{ns:00}}
2915 !! result
2916
2917 !! end
2918
2919 !! test
2920 Namespace -1 {{ns:-1}}
2921 !! input
2922 {{ns:-1}}
2923 !! result
2924 <p>Special
2925 </p>
2926 !! end
2927
2928 !! test
2929 Namespace User {{ns:User}}
2930 !! input
2931 {{ns:User}}
2932 !! result
2933 <p>User
2934 </p>
2935 !! end
2936
2937 !! test
2938 Namespace User talk {{ns:User_talk}}
2939 !! input
2940 {{ns:User_talk}}
2941 !! result
2942 <p>User talk
2943 </p>
2944 !! end
2945
2946 !! test
2947 Namespace User talk {{ns:uSeR tAlK}}
2948 !! input
2949 {{ns:uSeR tAlK}}
2950 !! result
2951 <p>User talk
2952 </p>
2953 !! end
2954
2955 !! test
2956 Namespace File {{ns:File}}
2957 !! input
2958 {{ns:File}}
2959 !! result
2960 <p>File
2961 </p>
2962 !! end
2963
2964 !! test
2965 Namespace File {{ns:Image}}
2966 !! input
2967 {{ns:Image}}
2968 !! result
2969 <p>File
2970 </p>
2971 !! end
2972
2973 !! test
2974 Namespace (lang=de) Benutzer {{ns:User}}
2975 !! options
2976 language=de
2977 !! input
2978 {{ns:User}}
2979 !! result
2980 <p>Benutzer
2981 </p>
2982 !! end
2983
2984 !! test
2985 Namespace (lang=de) Benutzer Diskussion {{ns:3}}
2986 !! options
2987 language=de
2988 !! input
2989 {{ns:3}}
2990 !! result
2991 <p>Benutzer Diskussion
2992 </p>
2993 !! end
2994
2995
2996 !! test
2997 Urlencode
2998 !! input
2999 {{urlencode:hi world?!}}
3000 {{urlencode:hi world?!|WIKI}}
3001 {{urlencode:hi world?!|PATH}}
3002 {{urlencode:hi world?!|QUERY}}
3003 !! result
3004 <p>hi+world%3F%21
3005 hi_world%3F!
3006 hi%20world%3F%21
3007 hi+world%3F%21
3008 </p>
3009 !! end
3010
3011 ###
3012 ### Magic links
3013 ###
3014 !! test
3015 Magic links: internal link to RFC (bug 479)
3016 !! input
3017 [[RFC 123]]
3018 !! result
3019 <p><a href="/index.php?title=RFC_123&amp;action=edit&amp;redlink=1" class="new" title="RFC 123 (page does not exist)">RFC 123</a>
3020 </p>
3021 !! end
3022
3023 !! test
3024 Magic links: RFC (bug 479)
3025 !! input
3026 RFC 822
3027 !! result
3028 <p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc822">RFC 822</a>
3029 </p>
3030 !! end
3031
3032 !! test
3033 Magic links: ISBN (bug 1937)
3034 !! input
3035 ISBN 0-306-40615-2
3036 !! result
3037 <p><a href="/wiki/Special:BookSources/0306406152" class="internal mw-magiclink-isbn">ISBN 0-306-40615-2</a>
3038 </p>
3039 !! end
3040
3041 !! test
3042 Magic links: PMID incorrectly converts space to underscore
3043 !! input
3044 PMID 1234
3045 !! result
3046 <p><a class="external mw-magiclink-pmid" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
3047 </p>
3048 !! end
3049
3050 ###
3051 ### Templates
3052 ####
3053
3054 !! test
3055 Nonexistent template
3056 !! input
3057 {{thistemplatedoesnotexist}}
3058 !! result
3059 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit&amp;redlink=1" class="new" title="Template:Thistemplatedoesnotexist (page does not exist)">Template:Thistemplatedoesnotexist</a>
3060 </p>
3061 !! end
3062
3063 !! article
3064 Template:test
3065 !! text
3066 This is a test template
3067 !! endarticle
3068
3069 !! test
3070 Simple template
3071 !! input
3072 {{test}}
3073 !! result
3074 <p>This is a test template
3075 </p>
3076 !! end
3077
3078 !! test
3079 Template with explicit namespace
3080 !! input
3081 {{Template:test}}
3082 !! result
3083 <p>This is a test template
3084 </p>
3085 !! end
3086
3087
3088 !! article
3089 Template:paramtest
3090 !! text
3091 This is a test template with parameter {{{param}}}
3092 !! endarticle
3093
3094 !! test
3095 Template parameter
3096 !! input
3097 {{paramtest|param=foo}}
3098 !! result
3099 <p>This is a test template with parameter foo
3100 </p>
3101 !! end
3102
3103 !! article
3104 Template:paramtestnum
3105 !! text
3106 [[{{{1}}}|{{{2}}}]]
3107 !! endarticle
3108
3109 !! test
3110 Template unnamed parameter
3111 !! input
3112 {{paramtestnum|Main Page|the main page}}
3113 !! result
3114 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
3115 </p>
3116 !! end
3117
3118 !! article
3119 Template:templatesimple
3120 !! text
3121 (test)
3122 !! endarticle
3123
3124 !! article
3125 Template:templateredirect
3126 !! text
3127 #redirect [[Template:templatesimple]]
3128 !! endarticle
3129
3130 !! article
3131 Template:templateasargtestnum
3132 !! text
3133 {{{{{1}}}}}
3134 !! endarticle
3135
3136 !! article
3137 Template:templateasargtest
3138 !! text
3139 {{template{{{templ}}}}}
3140 !! endarticle
3141
3142 !! article
3143 Template:templateasargtest2
3144 !! text
3145 {{{{{templ}}}}}
3146 !! endarticle
3147
3148 !! test
3149 Template with template name as unnamed argument
3150 !! input
3151 {{templateasargtestnum|templatesimple}}
3152 !! result
3153 <p>(test)
3154 </p>
3155 !! end
3156
3157 !! test
3158 Template with template name as argument
3159 !! input
3160 {{templateasargtest|templ=simple}}
3161 !! result
3162 <p>(test)
3163 </p>
3164 !! end
3165
3166 !! test
3167 Template with template name as argument (2)
3168 !! input
3169 {{templateasargtest2|templ=templatesimple}}
3170 !! result
3171 <p>(test)
3172 </p>
3173 !! end
3174
3175 !! article
3176 Template:templateasargtestdefault
3177 !! text
3178 {{{{{templ|templatesimple}}}}}
3179 !! endarticle
3180
3181 !! article
3182 Template:templa
3183 !! text
3184 '''templ'''
3185 !! endarticle
3186
3187 !! test
3188 Template with default value
3189 !! input
3190 {{templateasargtestdefault}}
3191 !! result
3192 <p>(test)
3193 </p>
3194 !! end
3195
3196 !! test
3197 Template with default value (value set)
3198 !! input
3199 {{templateasargtestdefault|templ=templa}}
3200 !! result
3201 <p><b>templ</b>
3202 </p>
3203 !! end
3204
3205 !! test
3206 Template redirect
3207 !! input
3208 {{templateredirect}}
3209 !! result
3210 <p>(test)
3211 </p>
3212 !! end
3213
3214 !! test
3215 Template with argument in separate line
3216 !! input
3217 {{ templateasargtest |
3218 templ = simple }}
3219 !! result
3220 <p>(test)
3221 </p>
3222 !! end
3223
3224 !! test
3225 Template with complex template as argument
3226 !! input
3227 {{paramtest|
3228 param ={{ templateasargtest |
3229 templ = simple }}}}
3230 !! result
3231 <p>This is a test template with parameter (test)
3232 </p>
3233 !! end
3234
3235 !! test
3236 Template with thumb image (with link in description)
3237 !! input
3238 {{paramtest|
3239 param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
3240 !! result
3241 This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
3242
3243 !! end
3244
3245 !! article
3246 Template:complextemplate
3247 !! text
3248 {{{1}}} {{paramtest|
3249 param ={{{param}}}}}
3250 !! endarticle
3251
3252 !! test
3253 Template with complex arguments
3254 !! input
3255 {{complextemplate|
3256 param ={{ templateasargtest |
3257 templ = simple }}|[[Template:complextemplate|link]]}}
3258 !! result
3259 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
3260 </p>
3261 !! end
3262
3263 !! test
3264 BUG 553: link with two variables in a piped link
3265 !! input
3266 {|
3267 |[[{{{1}}}|{{{2}}}]]
3268 |}
3269 !! result
3270 <table>
3271 <tr>
3272 <td>[[{{{1}}}|{{{2}}}]]
3273 </td></tr></table>
3274
3275 !! end
3276
3277 !! test
3278 Magic variable as template parameter
3279 !! input
3280 {{paramtest|param={{SITENAME}}}}
3281 !! result
3282 <p>This is a test template with parameter MediaWiki
3283 </p>
3284 !! end
3285
3286 !! article
3287 Template:linktest
3288 !! text
3289 [[{{{param}}}|link]]
3290 !! endarticle
3291
3292 !! test
3293 Template parameter as link source
3294 !! input
3295 {{linktest|param=Main Page}}
3296 !! result
3297 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
3298 </p>
3299 !! end
3300
3301
3302 !!article
3303 Template:paramtest2
3304 !! text
3305 including another template, {{paramtest|param={{{arg}}}}}
3306 !! endarticle
3307
3308 !! test
3309 Template passing argument to another template
3310 !! input
3311 {{paramtest2|arg='hmm'}}
3312 !! result
3313 <p>including another template, This is a test template with parameter 'hmm'
3314 </p>
3315 !! end
3316
3317 !! article
3318 Template:Linktest2
3319 !! text
3320 Main Page
3321 !! endarticle
3322
3323 !! test
3324 Template as link source
3325 !! input
3326 [[{{linktest2}}]]
3327 !! result
3328 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
3329 </p>
3330 !! end
3331
3332
3333 !! article
3334 Template:loop1
3335 !! text
3336 {{loop2}}
3337 !! endarticle
3338
3339 !! article
3340 Template:loop2
3341 !! text
3342 {{loop1}}
3343 !! endarticle
3344
3345 !! test
3346 Template infinite loop
3347 !! input
3348 {{loop1}}
3349 !! result
3350 <p><span class="error">Template loop detected: <a href="/wiki/Template:Loop1" title="Template:Loop1">Template:Loop1</a></span>
3351 </p>
3352 !! end
3353
3354 !! test
3355 Template from main namespace
3356 !! input
3357 {{:Main Page}}
3358 !! result
3359 <p>blah blah
3360 </p>
3361 !! end
3362
3363 !! article
3364 Template:table
3365 !! text
3366 {|
3367 | 1 || 2
3368 |-
3369 | 3 || 4
3370 |}
3371 !! endarticle
3372
3373 !! test
3374 BUG 529: Template with table, not included at beginning of line
3375 !! input
3376 foo {{table}}
3377 !! result
3378 <p>foo
3379 </p>
3380 <table>
3381 <tr>
3382 <td> 1 </td>
3383 <td> 2
3384 </td></tr>
3385 <tr>
3386 <td> 3 </td>
3387 <td> 4
3388 </td></tr></table>
3389
3390 !! end
3391
3392 !! test
3393 BUG 523: Template shouldn't eat newline (or add an extra one before table)
3394 !! input
3395 foo
3396 {{table}}
3397 !! result
3398 <p>foo
3399 </p>
3400 <table>
3401 <tr>
3402 <td> 1 </td>
3403 <td> 2
3404 </td></tr>
3405 <tr>
3406 <td> 3 </td>
3407 <td> 4
3408 </td></tr></table>
3409
3410 !! end
3411
3412 !! test
3413 BUG 41: Template parameters shown as broken links
3414 !! input
3415 {{{parameter}}}
3416 !! result
3417 <p>{{{parameter}}}
3418 </p>
3419 !! end
3420
3421
3422 !! article
3423 Template:MSGNW test
3424 !! text
3425 ''None'' of '''this''' should be
3426 * interpreted
3427 but rather passed unmodified
3428 {{test}}
3429 !! endarticle
3430
3431 # hmm, fix this or just deprecate msgnw and document its behavior?
3432 !! test
3433 msgnw keyword
3434 !! options
3435 disabled
3436 !! input
3437 {{msgnw:MSGNW test}}
3438 !! result
3439 <p>''None'' of '''this''' should be
3440 * interpreted
3441 but rather passed unmodified
3442 {{test}}
3443 </p>
3444 !! end
3445
3446 !! test
3447 int keyword
3448 !! input
3449 {{int:youhavenewmessages|lots of money|not!}}
3450 !! result
3451 <p>You have lots of money (not!).
3452 </p>
3453 !! end
3454
3455 !! article
3456 Template:Includes
3457 !! text
3458 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
3459 !! endarticle
3460
3461 !! test
3462 <includeonly> and <noinclude> being included
3463 !! input
3464 {{Includes}}
3465 !! result
3466 <p>Foobar
3467 </p>
3468 !! end
3469
3470 !! article
3471 Template:Includes2
3472 !! text
3473 <onlyinclude>Foo</onlyinclude>bar
3474 !! endarticle
3475
3476 !! test
3477 <onlyinclude> being included
3478 !! input
3479 {{Includes2}}
3480 !! result
3481 <p>Foo
3482 </p>
3483 !! end
3484
3485
3486 !! article
3487 Template:Includes3
3488 !! text
3489 <onlyinclude>Foo</onlyinclude>bar<includeonly>zar</includeonly>
3490 !! endarticle
3491
3492 !! test
3493 <onlyinclude> and <includeonly> being included
3494 !! input
3495 {{Includes3}}
3496 !! result
3497 <p>Foo
3498 </p>
3499 !! end
3500
3501 !! test
3502 <includeonly> and <noinclude> on a page
3503 !! input
3504 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
3505 !! result
3506 <p>Foozar
3507 </p>
3508 !! end
3509
3510 !! test
3511 <onlyinclude> on a page
3512 !! input
3513 <onlyinclude>Foo</onlyinclude>bar
3514 !! result
3515 <p>Foobar
3516 </p>
3517 !! end
3518
3519 !! article
3520 Template:Includeonly section
3521 !! text
3522 <includeonly>
3523 ==Includeonly section==
3524 </includeonly>
3525 ==Section T-1==
3526 !!endarticle
3527
3528 !! test
3529 Bug 6563: Edit link generation for section shown by <includeonly>
3530 !! input
3531 {{includeonly section}}
3532 !! result
3533 <h2><span class="editsection">[<a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Includeonly_section">Includeonly section</span></h2>
3534 <h2><span class="editsection">[<a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Section_T-1">Section T-1</span></h2>
3535
3536 !! end
3537
3538 # Uses same input as the contents of [[Template:Includeonly section]]
3539 !! test
3540 Bug 6563: Section extraction for section shown by <includeonly>
3541 !! options
3542 section=T-2
3543 !! input
3544 <includeonly>
3545 ==Includeonly section==
3546 </includeonly>
3547 ==Section T-2==
3548 !! result
3549 ==Section T-2==
3550 !! end
3551
3552 !! test
3553 Bug 6563: Edit link generation for section suppressed by <includeonly>
3554 !! input
3555 <includeonly>
3556 ==Includeonly section==
3557 </includeonly>
3558 ==Section 1==
3559 !! result
3560 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
3561
3562 !! end
3563
3564 !! test
3565 Bug 6563: Section extraction for section suppressed by <includeonly>
3566 !! options
3567 section=1
3568 !! input
3569 <includeonly>
3570 ==Includeonly section==
3571 </includeonly>
3572 ==Section 1==
3573 !! result
3574 ==Section 1==
3575 !! end
3576
3577 ###
3578 ### Pre-save transform tests
3579 ###
3580 !! test
3581 pre-save transform: subst:
3582 !! options
3583 PST
3584 !! input
3585 {{subst:test}}
3586 !! result
3587 This is a test template
3588 !! end
3589
3590 !! test
3591 pre-save transform: normal template
3592 !! options
3593 PST
3594 !! input
3595 {{test}}
3596 !! result
3597 {{test}}
3598 !! end
3599
3600 !! test
3601 pre-save transform: nonexistent template
3602 !! options
3603 PST
3604 !! input
3605 {{thistemplatedoesnotexist}}
3606 !! result
3607 {{thistemplatedoesnotexist}}
3608 !! end
3609
3610
3611 !! test
3612 pre-save transform: subst magic variables
3613 !! options
3614 PST
3615 !! input
3616 {{subst:SITENAME}}
3617 !! result
3618 MediaWiki
3619 !! end
3620
3621 # This is bug 89, which I fixed. -- wtm
3622 !! test
3623 pre-save transform: subst: templates with parameters
3624 !! options
3625 pst
3626 !! input
3627 {{subst:paramtest|param="something else"}}
3628 !! result
3629 This is a test template with parameter "something else"
3630 !! end
3631
3632 !! article
3633 Template:nowikitest
3634 !! text
3635 <nowiki>'''not wiki'''</nowiki>
3636 !! endarticle
3637
3638 !! test
3639 pre-save transform: nowiki in subst (bug 1188)
3640 !! options
3641 pst
3642 !! input
3643 {{subst:nowikitest}}
3644 !! result
3645 <nowiki>'''not wiki'''</nowiki>
3646 !! end
3647
3648
3649 !! article
3650 Template:commenttest
3651 !! text
3652 This template has <!-- a comment --> in it.
3653 !! endarticle
3654
3655 !! test
3656 pre-save transform: comment in subst (bug 1936)
3657 !! options
3658 pst
3659 !! input
3660 {{subst:commenttest}}
3661 !! result
3662 This template has <!-- a comment --> in it.
3663 !! end
3664
3665 !! test
3666 pre-save transform: unclosed tag
3667 !! options
3668 pst noxml
3669 !! input
3670 <nowiki>'''not wiki'''
3671 !! result
3672 <nowiki>'''not wiki'''
3673 !! end
3674
3675 !! test
3676 pre-save transform: mixed tag case
3677 !! options
3678 pst noxml
3679 !! input
3680 <NOwiki>'''not wiki'''</noWIKI>
3681 !! result
3682 <NOwiki>'''not wiki'''</noWIKI>
3683 !! end
3684
3685 !! test
3686 pre-save transform: unclosed comment in <nowiki>
3687 !! options
3688 pst noxml
3689 !! input
3690 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
3691 !! result
3692 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
3693 !!end
3694
3695 !! article
3696 Template:dangerous
3697 !!text
3698 <span onmouseover="alert('crap')">Oh no</span>
3699 !!endarticle
3700
3701 !!test
3702 (confirming safety of fix for subst bug 1936)
3703 !! input
3704 {{Template:dangerous}}
3705 !! result
3706 <p><span>Oh no</span>
3707 </p>
3708 !! end
3709
3710 !! test
3711 pre-save transform: comment containing gallery (bug 5024)
3712 !! options
3713 pst
3714 !! input
3715 <!-- <gallery>data</gallery> -->
3716 !!result
3717 <!-- <gallery>data</gallery> -->
3718 !!end
3719
3720 !! test
3721 pre-save transform: comment containing extension
3722 !! options
3723 pst
3724 !! input
3725 <!-- <tag>data</tag> -->
3726 !!result
3727 <!-- <tag>data</tag> -->
3728 !!end
3729
3730 !! test
3731 pre-save transform: comment containing nowiki
3732 !! options
3733 pst
3734 !! input
3735 <!-- <nowiki>data</nowiki> -->
3736 !!result
3737 <!-- <nowiki>data</nowiki> -->
3738 !!end
3739
3740 !! test
3741 pre-save transform: <noinclude> in subst (bug 3298)
3742 !! options
3743 pst
3744 !! input
3745 {{subst:Includes}}
3746 !! result
3747 Foobar
3748 !! end
3749
3750 !! test
3751 pre-save transform: <onlyinclude> in subst (bug 3298)
3752 !! options
3753 pst
3754 !! input
3755 {{subst:Includes2}}
3756 !! result
3757 Foo
3758 !! end
3759
3760 !! article
3761 Template:SubstTest
3762 !!text
3763 {{<includeonly>subst:</includeonly>Includes}}
3764 !! endarticle
3765
3766 !! article
3767 Template:SafeSubstTest
3768 !! text
3769 {{<includeonly>safesubst:</includeonly>Includes}}
3770 !! endarticle
3771
3772 !! test
3773 bug 22297: safesubst: works during PST
3774 !! options
3775 pst
3776 !! input
3777 {{subst:SafeSubstTest}}{{safesubst:SubstTest}}
3778 !! result
3779 FoobarFoobar
3780 !! end
3781
3782 !! test
3783 bug 22297: safesubst: works during normal parse
3784 !! input
3785 {{SafeSubstTest}}
3786 !! result
3787 <p>Foobar
3788 </p>
3789 !! end
3790
3791 !! test:
3792 subst: does not work during normal parse
3793 !! input
3794 {{SubstTest}}
3795 !! result
3796 <p>{{subst:Includes}}
3797 </p>
3798 !! end
3799
3800 !! test
3801 pre-save transform: context links ("pipe trick")
3802 !! options
3803 pst
3804 !! input
3805 [[Article (context)|]]
3806 [[Bar:Article|]]
3807 [[:Bar:Article|]]
3808 [[Bar:Article (context)|]]
3809 [[:Bar:Article (context)|]]
3810 [[|Article]]
3811 [[|Article (context)]]
3812 [[Bar:X (Y) Z|]]
3813 [[:Bar:X (Y) Z|]]
3814 !! result
3815 [[Article (context)|Article]]
3816 [[Bar:Article|Article]]
3817 [[:Bar:Article|Article]]
3818 [[Bar:Article (context)|Article]]
3819 [[:Bar:Article (context)|Article]]
3820 [[Article]]
3821 [[Article (context)]]
3822 [[Bar:X (Y) Z|X (Y) Z]]
3823 [[:Bar:X (Y) Z|X (Y) Z]]
3824 !! end
3825
3826 !! test
3827 pre-save transform: context links ("pipe trick") with interwiki prefix
3828 !! options
3829 pst
3830 !! input
3831 [[interwiki:Article|]]
3832 [[:interwiki:Article|]]
3833 [[interwiki:Bar:Article|]]
3834 [[:interwiki:Bar:Article|]]
3835 !! result
3836 [[interwiki:Article|Article]]
3837 [[:interwiki:Article|Article]]
3838 [[interwiki:Bar:Article|Bar:Article]]
3839 [[:interwiki:Bar:Article|Bar:Article]]
3840 !! end
3841
3842 !! test
3843 pre-save transform: context links ("pipe trick") with parens in title
3844 !! options
3845 pst title=[[Somearticle (context)]]
3846 !! input
3847 [[|Article]]
3848 !! result
3849 [[Article (context)|Article]]
3850 !! end
3851
3852 !! test
3853 pre-save transform: context links ("pipe trick") with comma in title
3854 !! options
3855 pst title=[[Someplace, Somewhere]]
3856 !! input
3857 [[|Otherplace]]
3858 [[Otherplace, Elsewhere|]]
3859 [[Otherplace, Elsewhere, Anywhere|]]
3860 !! result
3861 [[Otherplace, Somewhere|Otherplace]]
3862 [[Otherplace, Elsewhere|Otherplace]]
3863 [[Otherplace, Elsewhere, Anywhere|Otherplace]]
3864 !! end
3865
3866 !! test
3867 pre-save transform: context links ("pipe trick") with parens and comma
3868 !! options
3869 pst title=[[Someplace (IGNORED), Somewhere]]
3870 !! input
3871 [[|Otherplace]]
3872 [[Otherplace (place), Elsewhere|]]
3873 !! result
3874 [[Otherplace, Somewhere|Otherplace]]
3875 [[Otherplace (place), Elsewhere|Otherplace]]
3876 !! end
3877
3878 !! test
3879 pre-save transform: context links ("pipe trick") with comma and parens
3880 !! options
3881 pst title=[[Who, me? (context)]]
3882 !! input
3883 [[|Yes, you.]]
3884 [[Me, Myself, and I (1937 song)|]]
3885 !! result
3886 [[Yes, you. (context)|Yes, you.]]
3887 [[Me, Myself, and I (1937 song)|Me, Myself, and I]]
3888 !! end
3889
3890 !! test
3891 pre-save transform: context links ("pipe trick") with namespace
3892 !! options
3893 pst title=[[Ns:Somearticle]]
3894 !! input
3895 [[|Article]]
3896 !! result
3897 [[Ns:Article|Article]]
3898 !! end
3899
3900 !! test
3901 pre-save transform: context links ("pipe trick") with namespace and parens
3902 !! options
3903 pst title=[[Ns:Somearticle (context)]]
3904 !! input
3905 [[|Article]]
3906 !! result
3907 [[Ns:Article (context)|Article]]
3908 !! end
3909
3910 !! test
3911 pre-save transform: context links ("pipe trick") with namespace and comma
3912 !! options
3913 pst title=[[Ns:Somearticle, Context, Whatever]]
3914 !! input
3915 [[|Article]]
3916 !! result
3917 [[Ns:Article, Context, Whatever|Article]]
3918 !! end
3919
3920 !! test
3921 pre-save transform: context links ("pipe trick") with namespace, comma and parens
3922 !! options
3923 pst title=[[Ns:Somearticle, Context (context)]]
3924 !! input
3925 [[|Article]]
3926 !! result
3927 [[Ns:Article (context)|Article]]
3928 !! end
3929
3930 !! test
3931 pre-save transform: context links ("pipe trick") with namespace, parens and comma
3932 !! options
3933 pst title=[[Ns:Somearticle (IGNORED), Context]]
3934 !! input
3935 [[|Article]]
3936 !! result
3937 [[Ns:Article, Context|Article]]
3938 !! end
3939
3940 !! test
3941 pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149)
3942 !! options
3943 pst
3944 !! input
3945 [[Article(context)|]]
3946 [[Bar:Article(context)|]]
3947 [[:Bar:Article(context)|]]
3948 [[|Article(context)]]
3949 [[Bar:X(Y)Z|]]
3950 [[:Bar:X(Y)Z|]]
3951 !! result
3952 [[Article(context)|Article]]
3953 [[Bar:Article(context)|Article]]
3954 [[:Bar:Article(context)|Article]]
3955 [[Article(context)]]
3956 [[Bar:X(Y)Z|X(Y)Z]]
3957 [[:Bar:X(Y)Z|X(Y)Z]]
3958 !! end
3959
3960 !! test
3961 pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149)
3962 !! options
3963 pst
3964 !! input
3965 [[Article (context)|]]
3966 [[Bar:Article (context)|]]
3967 [[:Bar:Article (context)|]]
3968 [[|Article (context)]]
3969 [[Bar:X (Y) Z|]]
3970 [[:Bar:X (Y) Z|]]
3971 !! result
3972 [[Article (context)|Article]]
3973 [[Bar:Article (context)|Article]]
3974 [[:Bar:Article (context)|Article]]
3975 [[Article (context)]]
3976 [[Bar:X (Y) Z|X (Y) Z]]
3977 [[:Bar:X (Y) Z|X (Y) Z]]
3978 !! end
3979
3980 !! test
3981 pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149)
3982 !! options
3983 pst
3984 !! input
3985 [[Article(context)|]]
3986 [[Bar:Article(context)|]]
3987 [[:Bar:Article(context)|]]
3988 [[|Article(context)]]
3989 [[Bar:X(Y)Z|]]
3990 [[:Bar:X(Y)Z|]]
3991 !! result
3992 [[Article(context)|Article]]
3993 [[Bar:Article(context)|Article]]
3994 [[:Bar:Article(context)|Article]]
3995 [[Article(context)]]
3996 [[Bar:X(Y)Z|X(Y)Z]]
3997 [[:Bar:X(Y)Z|X(Y)Z]]
3998 !! end
3999
4000 !! test
4001 pre-save transform: context links ("pipe trick") with commas (bug 21660)
4002 !! options
4003 pst
4004 !! input
4005 [[Article (context), context|]]
4006 [[Article (context),context|]]
4007 [[Bar:Article (context), context|]]
4008 [[Bar:Article (context),context|]]
4009 [[:Bar:Article (context), context|]]
4010 [[:Bar:Article (context),context|]]
4011 !! result
4012 [[Article (context), context|Article]]
4013 [[Article (context),context|Article]]
4014 [[Bar:Article (context), context|Article]]
4015 [[Bar:Article (context),context|Article]]
4016 [[:Bar:Article (context), context|Article]]
4017 [[:Bar:Article (context),context|Article]]
4018 !! end
4019
4020 !! test
4021 pre-save transform: trim trailing empty lines
4022 !! options
4023 pst
4024 !! input
4025 Empty lines are trimmed
4026
4027
4028
4029
4030 !! result
4031 Empty lines are trimmed
4032 !! end
4033
4034 !! test
4035 pre-save transform: Signature expansion
4036 !! options
4037 pst
4038 !! input
4039 * ~~~
4040 * <noinclude>~~~</noinclude>
4041 * <includeonly>~~~</includeonly>
4042 * <onlyinclude>~~~</onlyinclude>
4043 !! result
4044 * [[Special:Contributions/127.0.0.1|127.0.0.1]]
4045 * <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
4046 * <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
4047 * <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
4048 !! end
4049
4050
4051 !! test
4052 pre-save transform: Signature expansion in nowiki tags (bug 93)
4053 !! options
4054 pst disabled
4055 !! input
4056 Shall not expand:
4057
4058 <nowiki>~~~~</nowiki>
4059
4060 <includeonly><nowiki>~~~~</nowiki></includeonly>
4061
4062 <noinclude><nowiki>~~~~</nowiki></noinclude>
4063
4064 <onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
4065
4066 {{subst:Foo}} shall be converted to FOO
4067
4068 As well as inside noinclude/onlyinclude
4069 <noinclude>{{subst:Foo}}</noinclude>
4070 <onlyinclude>{{subst:Foo}}</onlyinclude>
4071
4072 But not inside includeonly
4073 <includeonly>{{subst:Foo}}</includeonly>
4074 !! result
4075 Shall not expand:
4076
4077 <nowiki>~~~~</nowiki>
4078
4079 <includeonly><nowiki>~~~~</nowiki></includeonly>
4080
4081 <noinclude><nowiki>~~~~</nowiki></noinclude>
4082
4083 <onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
4084
4085 FOO shall be converted to FOO
4086
4087 As well as inside noinclude/onlyinclude
4088 <noinclude>FOO</noinclude>
4089 <onlyinclude>FOO</onlyinclude>
4090
4091 But not inside includeonly
4092 <includeonly>{{subst:Foo}}</includeonly>
4093 !! end
4094
4095 ###
4096 ### Message transform tests
4097 ###
4098 !! test
4099 message transform: magic variables
4100 !! options
4101 msg
4102 !! input
4103 {{SITENAME}}
4104 !! result
4105 MediaWiki
4106 !! end
4107
4108 !! test
4109 message transform: should not transform wiki markup
4110 !! options
4111 msg
4112 !! input
4113 ''test''
4114 !! result
4115 ''test''
4116 !! end
4117
4118 !! test
4119 message transform: <noinclude> in transcluded template (bug 4926)
4120 !! options
4121 msg
4122 !! input
4123 {{Includes}}
4124 !! result
4125 Foobar
4126 !! end
4127
4128 !! test
4129 message transform: <onlyinclude> in transcluded template (bug 4926)
4130 !! options
4131 msg
4132 !! input
4133 {{Includes2}}
4134 !! result
4135 Foo
4136 !! end
4137
4138 !! test
4139 {{#special:}} page name, known
4140 !! options
4141 msg
4142 !! input
4143 {{#special:Recentchanges}}
4144 !! result
4145 Special:RecentChanges
4146 !! end
4147
4148 !! test
4149 {{#special:}} page name with subpage, known
4150 !! options
4151 msg
4152 !! input
4153 {{#special:Recentchanges/param}}
4154 !! result
4155 Special:RecentChanges/param
4156 !! end
4157
4158 !! test
4159 {{#special:}} page name, unknown
4160 !! options
4161 msg
4162 !! input
4163 {{#special:foobarnonexistent}}
4164 !! result
4165 No such special page
4166 !! end
4167
4168 !! test
4169 {{#speciale:}} page name, known
4170 !! options
4171 msg
4172 !! input
4173 {{#speciale:Recentchanges}}
4174 !! result
4175 Special:RecentChanges
4176 !! end
4177
4178 !! test
4179 {{#speciale:}} page name with subpage, known
4180 !! options
4181 msg
4182 !! input
4183 {{#speciale:Recentchanges/param}}
4184 !! result
4185 Special:RecentChanges/param
4186 !! end
4187
4188 !! test
4189 {{#speciale:}} page name, unknown
4190 !! options
4191 msg
4192 !! input
4193 {{#speciale:foobarnonexistent}}
4194 !! result
4195 No_such_special_page
4196 !! end
4197
4198 ###
4199 ### Images
4200 ###
4201 !! test
4202 Simple image
4203 !! input
4204 [[Image:foobar.jpg]]
4205 !! result
4206 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4207 </p>
4208 !! end
4209
4210 !! test
4211 Right-aligned image
4212 !! input
4213 [[Image:foobar.jpg|right]]
4214 !! result
4215 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
4216
4217 !! end
4218
4219 !! test
4220 Simple image (using File: namespace, now canonical)
4221 !! input
4222 [[File:foobar.jpg]]
4223 !! result
4224 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4225 </p>
4226 !! end
4227
4228 !! test
4229 Image with caption
4230 !! input
4231 [[Image:foobar.jpg|right|Caption text]]
4232 !! result
4233 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
4234
4235 !! end
4236
4237 !! test
4238 Image with link parameter, wiki target
4239 !! input
4240 [[Image:foobar.jpg|link=Target page]]
4241 !! result
4242 <p><a href="/wiki/Target_page" title="Target page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4243 </p>
4244 !! end
4245
4246 !! test
4247 Image with link parameter, URL target
4248 !! input
4249 [[Image:foobar.jpg|link=http://example.com/]]
4250 !! result
4251 <p><a href="http://example.com/"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4252 </p>
4253 !! end
4254
4255 !! test
4256 Image with link parameter, wgExternalLinkTarget
4257 !! input
4258 [[Image:foobar.jpg|link=http://example.com/]]
4259 !! config
4260 wgExternalLinkTarget='foobar'
4261 !! result
4262 <p><a href="http://example.com/" target="foobar"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4263 </p>
4264 !! end
4265
4266 !! test
4267 Image with link parameter, wgExternalLinkTarget, unnamed parameter
4268 !! input
4269 [[Image:foobar.jpg|link=http://example.com/|Title]]
4270 !! config
4271 wgExternalLinkTarget='foobar'
4272 !! result
4273 <p><a href="http://example.com/" title="Title" target="foobar"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4274 </p>
4275 !! end
4276
4277 !! test
4278 Image with empty link parameter
4279 !! input
4280 [[Image:foobar.jpg|link=]]
4281 !! result
4282 <p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" />
4283 </p>
4284 !! end
4285
4286 !! test
4287 Image with link parameter (wiki target) and unnamed parameter
4288 !! input
4289 [[Image:foobar.jpg|link=Target page|Title]]
4290 !! result
4291 <p><a href="/wiki/Target_page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4292 </p>
4293 !! end
4294
4295 !! test
4296 Image with link parameter (URL target) and unnamed parameter
4297 !! input
4298 [[Image:foobar.jpg|link=http://example.com/|Title]]
4299 !! result
4300 <p><a href="http://example.com/" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4301 </p>
4302 !! end
4303
4304 !! test
4305 Thumbnail image with link parameter
4306 !! input
4307 [[Image:foobar.jpg|thumb|link=http://example.com/|Title]]
4308 !! result
4309 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="http://example.com/"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Title</div></div></div>
4310
4311 !! end
4312
4313 !! test
4314 Image with frame and link
4315 !! input
4316 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
4317 !! result
4318 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
4319
4320 !! end
4321
4322 !! test
4323 Image with frame and link and explicit alt
4324 !! input
4325 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
4326 !! result
4327 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a> <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
4328
4329 !! end
4330
4331 !! test
4332 Image with wiki markup in implicit alt
4333 !! input
4334 [[Image:Foobar.jpg|testing '''bold''' in alt]]
4335 !! result
4336 <p><a href="/wiki/File:Foobar.jpg" class="image" title="testing bold in alt"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4337 </p>
4338 !! end
4339
4340 !! test
4341 Image with wiki markup in explicit alt
4342 !! input
4343 [[Image:Foobar.jpg|alt=testing '''bold''' in alt]]
4344 !! result
4345 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4346 </p>
4347 !! end
4348
4349 !! test
4350 Link to image page- image page normally doesn't exists, hence edit link
4351 Add test with existing image page
4352 #<p><a href="/wiki/File:Test" title="Image:Test">Image:test</a>
4353 !! input
4354 [[:Image:test]]
4355 !! result
4356 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a>
4357 </p>
4358 !! end
4359
4360 !! test
4361 bug 18784 Link to non-existent image page with caption should use caption as link text
4362 !! input
4363 [[:Image:test|caption]]
4364 !! result
4365 <p><a href="/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
4366 </p>
4367 !! end
4368
4369 !! test
4370 Frameless image caption with a free URL
4371 !! input
4372 [[Image:foobar.jpg|http://example.com]]
4373 !! result
4374 <p><a href="/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4375 </p>
4376 !! end
4377
4378 !! test
4379 Thumbnail image caption with a free URL
4380 !! input
4381 [[Image:foobar.jpg|thumb|http://example.com]]
4382 !! result
4383 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
4384
4385 !! end
4386
4387 !! test
4388 Thumbnail image caption with a free URL and explicit alt
4389 !! input
4390 [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
4391 !! result
4392 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
4393
4394 !! end
4395
4396 !! test
4397 BUG 1887: A ISBN with a thumbnail
4398 !! input
4399 [[Image:foobar.jpg|thumb|ISBN 1235467890]]
4400 !! result
4401 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
4402
4403 !! end
4404
4405 !! test
4406 BUG 1887: A RFC with a thumbnail
4407 !! input
4408 [[Image:foobar.jpg|thumb|This is RFC 12354]]
4409 !! result
4410 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
4411
4412 !! end
4413
4414 !! test
4415 BUG 1887: A mailto link with a thumbnail
4416 !! input
4417 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
4418 !! result
4419 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a rel="nofollow" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></div></div></div>
4420
4421 !! end
4422
4423 # Pending resolution to bug 368
4424 !! test
4425 BUG 648: Frameless image caption with a link
4426 !! input
4427 [[Image:foobar.jpg|text with a [[link]] in it]]
4428 !! result
4429 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4430 </p>
4431 !! end
4432
4433 !! test
4434 BUG 648: Frameless image caption with a link (suffix)
4435 !! input
4436 [[Image:foobar.jpg|text with a [[link]]foo in it]]
4437 !! result
4438 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4439 </p>
4440 !! end
4441
4442 !! test
4443 BUG 648: Frameless image caption with an interwiki link
4444 !! input
4445 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
4446 !! result
4447 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4448 </p>
4449 !! end
4450
4451 !! test
4452 BUG 648: Frameless image caption with a piped interwiki link
4453 !! input
4454 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
4455 !! result
4456 <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4457 </p>
4458 !! end
4459
4460 !! test
4461 Escape HTML special chars in image alt text
4462 !! input
4463 [[Image:foobar.jpg|& < > "]]
4464 !! result
4465 <p><a href="/wiki/File:Foobar.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img alt="&amp; &lt; &gt; &quot;" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4466 </p>
4467 !! end
4468
4469 !! test
4470 BUG 499: Alt text should have &#1234;, not &amp;1234;
4471 !! input
4472 [[Image:foobar.jpg|&#9792;]]
4473 !! result
4474 <p><a href="/wiki/File:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4475 </p>
4476 !! end
4477
4478 !! test
4479 Broken image caption with link
4480 !! input
4481 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
4482 !! result
4483 <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.
4484 </p>
4485 !! end
4486
4487 !! test
4488 Image caption containing another image
4489 !! input
4490 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
4491 !! result
4492 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
4493
4494 !! end
4495
4496 !! test
4497 Image caption containing a newline
4498 !! input
4499 [[Image:Foobar.jpg|This
4500 *is some text]]
4501 !! result
4502 <p><a href="/wiki/File:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4503 </p>
4504 !!end
4505
4506
4507 !! test
4508 Bug 3090: External links other than http: in image captions
4509 !! input
4510 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
4511 !! result
4512 <div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</div></div></div>
4513
4514 !! end
4515
4516 !! article
4517 File:Barfoo.jpg
4518 !! text
4519 #REDIRECT [[File:Barfoo.jpg]]
4520 !! endarticle
4521
4522 !! test
4523 Redirected image
4524 !! input
4525 [[Image:Barfoo.jpg]]
4526 !! result
4527 <p><a href="/wiki/File:Barfoo.jpg" title="File:Barfoo.jpg">File:Barfoo.jpg</a>
4528 </p>
4529 !! end
4530
4531 !! test
4532 Missing image with uploads disabled
4533 !! options
4534 wgEnableUploads=0
4535 !! input
4536 [[Image:Foobaz.jpg]]
4537 !! result
4538 <p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a>
4539 </p>
4540 !! end
4541
4542
4543 ###
4544 ### Subpages
4545 ###
4546 !! article
4547 Subpage test/subpage
4548 !! text
4549 foo
4550 !! endarticle
4551
4552 !! test
4553 Subpage link
4554 !! options
4555 subpage title=[[Subpage test]]
4556 !! input
4557 [[/subpage]]
4558 !! result
4559 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
4560 </p>
4561 !! end
4562
4563 !! test
4564 Subpage noslash link
4565 !! options
4566 subpage title=[[Subpage test]]
4567 !!input
4568 [[/subpage/]]
4569 !! result
4570 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
4571 </p>
4572 !! end
4573
4574 !! test
4575 Disabled subpages
4576 !! input
4577 [[/subpage]]
4578 !! result
4579 <p><a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a>
4580 </p>
4581 !! end
4582
4583 !! test
4584 BUG 561: {{/Subpage}}
4585 !! options
4586 subpage title=[[Page]]
4587 !! input
4588 {{/Subpage}}
4589 !! result
4590 <p><a href="/index.php?title=Page/Subpage&amp;action=edit&amp;redlink=1" class="new" title="Page/Subpage (page does not exist)">Page/Subpage</a>
4591 </p>
4592 !! end
4593
4594 ###
4595 ### Categories
4596 ###
4597 !! article
4598 Category:MediaWiki User's Guide
4599 !! text
4600 blah
4601 !! endarticle
4602
4603 !! test
4604 Link to category
4605 !! input
4606 [[:Category:MediaWiki User's Guide]]
4607 !! result
4608 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
4609 </p>
4610 !! end
4611
4612 !! test
4613 Simple category
4614 !! options
4615 cat
4616 !! input
4617 [[Category:MediaWiki User's Guide]]
4618 !! result
4619 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
4620 !! end
4621
4622 !! test
4623 PAGESINCATEGORY invalid title fatal (r33546 fix)
4624 !! input
4625 {{PAGESINCATEGORY:<bogus>}}
4626 !! result
4627 <p>0
4628 </p>
4629 !! end
4630
4631 ###
4632 ### Inter-language links
4633 ###
4634 !! test
4635 Inter-language links
4636 !! options
4637 ill
4638 !! input
4639 [[es:Alimento]]
4640 [[fr:Nourriture]]
4641 [[zh:&#39135;&#21697;]]
4642 !! result
4643 es:Alimento fr:Nourriture zh:食品
4644 !! end
4645
4646 ###
4647 ### Sections
4648 ###
4649 !! test
4650 Basic section headings
4651 !! input
4652 == Headline 1 ==
4653 Some text
4654
4655 ==Headline 2==
4656 More
4657 ===Smaller headline===
4658 Blah blah
4659 !! result
4660 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
4661 <p>Some text
4662 </p>
4663 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2">Headline 2</span></h2>
4664 <p>More
4665 </p>
4666 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline" id="Smaller_headline">Smaller headline</span></h3>
4667 <p>Blah blah
4668 </p>
4669 !! end
4670
4671 !! test
4672 Section headings with TOC
4673 !! input
4674 == Headline 1 ==
4675 === Subheadline 1 ===
4676 ===== Skipping a level =====
4677 ====== Skipping a level ======
4678
4679 == Headline 2 ==
4680 Some text
4681 ===Another headline===
4682 !! result
4683 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4684 <ul>
4685 <li class="toclevel-1 tocsection-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
4686 <ul>
4687 <li class="toclevel-2 tocsection-2"><a href="#Subheadline_1"><span class="tocnumber">1.1</span> <span class="toctext">Subheadline 1</span></a>
4688 <ul>
4689 <li class="toclevel-3 tocsection-3"><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
4690 <ul>
4691 <li class="toclevel-4 tocsection-4"><a href="#Skipping_a_level_2"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Skipping a level</span></a></li>
4692 </ul>
4693 </li>
4694 </ul>
4695 </li>
4696 </ul>
4697 </li>
4698 <li class="toclevel-1 tocsection-5"><a href="#Headline_2"><span class="tocnumber">2</span> <span class="toctext">Headline 2</span></a>
4699 <ul>
4700 <li class="toclevel-2 tocsection-6"><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
4701 </ul>
4702 </li>
4703 </ul>
4704 </td></tr></table>
4705 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
4706 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline" id="Subheadline_1"> Subheadline 1 </span></h3>
4707 <h5><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level"> Skipping a level </span></h5>
4708 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level_2"> Skipping a level </span></h6>
4709 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2"> Headline 2 </span></h2>
4710 <p>Some text
4711 </p>
4712 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline" id="Another_headline">Another headline</span></h3>
4713
4714 !! end
4715
4716 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
4717 !! test
4718 Handling of sections up to level 6 and beyond
4719 !! input
4720 = Level 1 Heading=
4721 == Level 2 Heading==
4722 === Level 3 Heading===
4723 ==== Level 4 Heading====
4724 ===== Level 5 Heading=====
4725 ====== Level 6 Heading======
4726 ======= Level 7 Heading=======
4727 ======== Level 8 Heading========
4728 ========= Level 9 Heading=========
4729 ========== Level 10 Heading==========
4730 !! result
4731 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4732 <ul>
4733 <li class="toclevel-1 tocsection-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
4734 <ul>
4735 <li class="toclevel-2 tocsection-2"><a href="#Level_2_Heading"><span class="tocnumber">1.1</span> <span class="toctext">Level 2 Heading</span></a>
4736 <ul>
4737 <li class="toclevel-3 tocsection-3"><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
4738 <ul>
4739 <li class="toclevel-4 tocsection-4"><a href="#Level_4_Heading"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Level 4 Heading</span></a>
4740 <ul>
4741 <li class="toclevel-5 tocsection-5"><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
4742 <ul>
4743 <li class="toclevel-6 tocsection-6"><a href="#Level_6_Heading"><span class="tocnumber">1.1.1.1.1.1</span> <span class="toctext">Level 6 Heading</span></a></li>
4744 <li class="toclevel-6 tocsection-7"><a href="#.3D_Level_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">= Level 7 Heading=</span></a></li>
4745 <li class="toclevel-6 tocsection-8"><a href="#.3D.3D_Level_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">== Level 8 Heading==</span></a></li>
4746 <li class="toclevel-6 tocsection-9"><a href="#.3D.3D.3D_Level_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">=== Level 9 Heading===</span></a></li>
4747 <li class="toclevel-6 tocsection-10"><a href="#.3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">==== Level 10 Heading====</span></a></li>
4748 </ul>
4749 </li>
4750 </ul>
4751 </li>
4752 </ul>
4753 </li>
4754 </ul>
4755 </li>
4756 </ul>
4757 </li>
4758 </ul>
4759 </td></tr></table>
4760 <h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline" id="Level_1_Heading"> Level 1 Heading</span></h1>
4761 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline" id="Level_2_Heading"> Level 2 Heading</span></h2>
4762 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline" id="Level_3_Heading"> Level 3 Heading</span></h3>
4763 <h4><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline" id="Level_4_Heading"> Level 4 Heading</span></h4>
4764 <h5><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline" id="Level_5_Heading"> Level 5 Heading</span></h5>
4765 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline" id="Level_6_Heading"> Level 6 Heading</span></h6>
4766 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline" id=".3D_Level_7_Heading.3D">= Level 7 Heading=</span></h6>
4767 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline" id=".3D.3D_Level_8_Heading.3D.3D">== Level 8 Heading==</span></h6>
4768 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D_Level_9_Heading.3D.3D.3D">=== Level 9 Heading===</span></h6>
4769 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D">==== Level 10 Heading====</span></h6>
4770
4771 !! end
4772
4773 !! test
4774 TOC regression (bug 9764)
4775 !! input
4776 == title 1 ==
4777 === title 1.1 ===
4778 ==== title 1.1.1 ====
4779 === title 1.2 ===
4780 == title 2 ==
4781 === title 2.1 ===
4782 !! result
4783 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4784 <ul>
4785 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
4786 <ul>
4787 <li class="toclevel-2 tocsection-2"><a href="#title_1.1"><span class="tocnumber">1.1</span> <span class="toctext">title 1.1</span></a>
4788 <ul>
4789 <li class="toclevel-3 tocsection-3"><a href="#title_1.1.1"><span class="tocnumber">1.1.1</span> <span class="toctext">title 1.1.1</span></a></li>
4790 </ul>
4791 </li>
4792 <li class="toclevel-2 tocsection-4"><a href="#title_1.2"><span class="tocnumber">1.2</span> <span class="toctext">title 1.2</span></a></li>
4793 </ul>
4794 </li>
4795 <li class="toclevel-1 tocsection-5"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a>
4796 <ul>
4797 <li class="toclevel-2 tocsection-6"><a href="#title_2.1"><span class="tocnumber">2.1</span> <span class="toctext">title 2.1</span></a></li>
4798 </ul>
4799 </li>
4800 </ul>
4801 </td></tr></table>
4802 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4803 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4804 <h4><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
4805 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
4806 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
4807 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
4808
4809 !! end
4810
4811 !! test
4812 TOC with wgMaxTocLevel=3 (bug 6204)
4813 !! options
4814 wgMaxTocLevel=3
4815 !! input
4816 == title 1 ==
4817 === title 1.1 ===
4818 ==== title 1.1.1 ====
4819 === title 1.2 ===
4820 == title 2 ==
4821 === title 2.1 ===
4822 !! result
4823 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4824 <ul>
4825 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
4826 <ul>
4827 <li class="toclevel-2 tocsection-2"><a href="#title_1.1"><span class="tocnumber">1.1</span> <span class="toctext">title 1.1</span></a></li>
4828 <li class="toclevel-2 tocsection-4"><a href="#title_1.2"><span class="tocnumber">1.2</span> <span class="toctext">title 1.2</span></a></li>
4829 </ul>
4830 </li>
4831 <li class="toclevel-1 tocsection-5"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a>
4832 <ul>
4833 <li class="toclevel-2 tocsection-6"><a href="#title_2.1"><span class="tocnumber">2.1</span> <span class="toctext">title 2.1</span></a></li>
4834 </ul>
4835 </li>
4836 </ul>
4837 </td></tr></table>
4838 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4839 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4840 <h4><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
4841 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
4842 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
4843 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
4844
4845 !! end
4846
4847 !! test
4848 TOC with wgMaxTocLevel=3 and two level four headings (bug 6204)
4849 !! options
4850 wgMaxTocLevel=3
4851 !! input
4852 ==Section 1==
4853 ===Section 1.1===
4854 ====Section 1.1.1====
4855 ====Section 1.1.1.1====
4856 ==Section 2==
4857 !! result
4858 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4859 <ul>
4860 <li class="toclevel-1 tocsection-1"><a href="#Section_1"><span class="tocnumber">1</span> <span class="toctext">Section 1</span></a>
4861 <ul>
4862 <li class="toclevel-2 tocsection-2"><a href="#Section_1.1"><span class="tocnumber">1.1</span> <span class="toctext">Section 1.1</span></a></li>
4863 </ul>
4864 </li>
4865 <li class="toclevel-1 tocsection-5"><a href="#Section_2"><span class="tocnumber">2</span> <span class="toctext">Section 2</span></a></li>
4866 </ul>
4867 </td></tr></table>
4868 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
4869 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Section 1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1">Section 1.1</span></h3>
4870 <h4><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Section 1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1">Section 1.1.1</span></h4>
4871 <h4><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Section 1.1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1.1">Section 1.1.1.1</span></h4>
4872 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Section 2">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
4873
4874 !! end
4875
4876
4877 !! test
4878 Resolving duplicate section names
4879 !! input
4880 == Foo bar ==
4881 == Foo bar ==
4882 !! result
4883 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
4884 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar_2"> Foo bar </span></h2>
4885
4886 !! end
4887
4888 !! test
4889 Resolving duplicate section names with differing case (bug 10721)
4890 !! input
4891 == Foo bar ==
4892 == Foo Bar ==
4893 !! result
4894 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
4895 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> Foo Bar </span></h2>
4896
4897 !! end
4898
4899 !! article
4900 Template:sections
4901 !! text
4902 ===Section 1===
4903 ==Section 2==
4904 !! endarticle
4905
4906 !! test
4907 Template with sections, __NOTOC__
4908 !! input
4909 __NOTOC__
4910 ==Section 0==
4911 {{sections}}
4912 ==Section 4==
4913 !! result
4914 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline" id="Section_0">Section 0</span></h2>
4915 <h3><span class="editsection">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-1" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h3>
4916 <h2><span class="editsection">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-2" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
4917 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline" id="Section_4">Section 4</span></h2>
4918
4919 !! end
4920
4921 !! test
4922 __NOEDITSECTION__ keyword
4923 !! input
4924 __NOEDITSECTION__
4925 ==Section 1==
4926 ==Section 2==
4927 !! result
4928 <h2> <span class="mw-headline" id="Section_1">Section 1</span></h2>
4929 <h2> <span class="mw-headline" id="Section_2">Section 2</span></h2>
4930
4931 !! end
4932
4933 !! test
4934 Link inside a section heading
4935 !! input
4936 ==Section with a [[Main Page|link]] in it==
4937 !! result
4938 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</span></h2>
4939
4940 !! end
4941
4942 !! test
4943 TOC regression (bug 12077)
4944 !! input
4945 __TOC__
4946 == title 1 ==
4947 === title 1.1 ===
4948 == title 2 ==
4949 !! result
4950 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4951 <ul>
4952 <li class="toclevel-1 tocsection-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
4953 <ul>
4954 <li class="toclevel-2 tocsection-2"><a href="#title_1.1"><span class="tocnumber">1.1</span> <span class="toctext">title 1.1</span></a></li>
4955 </ul>
4956 </li>
4957 <li class="toclevel-1 tocsection-3"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a></li>
4958 </ul>
4959 </td></tr></table>
4960 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4961 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4962 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
4963
4964 !! end
4965
4966 !! test
4967 BUG 1219 URL next to image (good)
4968 !! input
4969 http://example.com [[Image:foobar.jpg]]
4970 !! result
4971 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
4972 </p>
4973 !!end
4974
4975 !! test
4976 Short headings with trailing space should match behaviour of Parser::doHeadings (bug 19910)
4977 !! input
4978 ===
4979 The line above must have a trailing space!
4980 === <!--
4981 --> <!-- -->
4982 But just in case it doesn't...
4983 !! result
4984 <h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D">=</span></h1>
4985 <p>The line above must have a trailing space!
4986 </p>
4987 <h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D_2">=</span></h1>
4988 <p>But just in case it doesn't...
4989 </p>
4990 !! end
4991
4992 !! test
4993 Header with special characters (bug 25462)
4994 !! input
4995 The tooltips shall not show entities to the user (ie. be double escaped)
4996
4997 == text > text ==
4998 section 1
4999
5000 == text < text ==
5001 section 2
5002
5003 == text & text ==
5004 section 3
5005
5006 == text ' text ==
5007 section 4
5008
5009 == text " text ==
5010 section 5
5011 !! result
5012 <p>The tooltips shall not show entities to the user (ie. be double escaped)
5013 </p>
5014 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
5015 <ul>
5016 <li class="toclevel-1 tocsection-1"><a href="#text_.3E_text"><span class="tocnumber">1</span> <span class="toctext">text &gt; text</span></a></li>
5017 <li class="toclevel-1 tocsection-2"><a href="#text_.3C_text"><span class="tocnumber">2</span> <span class="toctext">text &lt; text</span></a></li>
5018 <li class="toclevel-1 tocsection-3"><a href="#text_.26_text"><span class="tocnumber">3</span> <span class="toctext">text &amp; text</span></a></li>
5019 <li class="toclevel-1 tocsection-4"><a href="#text_.27_text"><span class="tocnumber">4</span> <span class="toctext">text ' text</span></a></li>
5020 <li class="toclevel-1 tocsection-5"><a href="#text_.22_text"><span class="tocnumber">5</span> <span class="toctext">text " text</span></a></li>
5021 </ul>
5022 </td></tr></table>
5023 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: text > text">edit</a>]</span> <span class="mw-headline" id="text_.3E_text"> text &gt; text </span></h2>
5024 <p>section 1
5025 </p>
5026 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: text &lt; text">edit</a>]</span> <span class="mw-headline" id="text_.3C_text"> text &lt; text </span></h2>
5027 <p>section 2
5028 </p>
5029 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: text &amp; text">edit</a>]</span> <span class="mw-headline" id="text_.26_text"> text &amp; text </span></h2>
5030 <p>section 3
5031 </p>
5032 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: text ' text">edit</a>]</span> <span class="mw-headline" id="text_.27_text"> text ' text </span></h2>
5033 <p>section 4
5034 </p>
5035 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: text &quot; text">edit</a>]</span> <span class="mw-headline" id="text_.22_text"> text " text </span></h2>
5036 <p>section 5
5037 </p>
5038 !! end
5039
5040 !! test
5041 BUG 1219 URL next to image (broken)
5042 !! input
5043 http://example.com[[Image:foobar.jpg]]
5044 !! result
5045 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
5046 </p>
5047 !!end
5048
5049 !! test
5050 Bug 1186 news: in the middle of text
5051 !! input
5052 http://en.wikinews.org/wiki/Wikinews:Workplace
5053 !! result
5054 <p><a rel="nofollow" class="external free" href="http://en.wikinews.org/wiki/Wikinews:Workplace">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
5055 </p>
5056 !!end
5057
5058
5059 !! test
5060 Namespaced link must have a title
5061 !! input
5062 [[Project:]]
5063 !! result
5064 <p>[[Project:]]
5065 </p>
5066 !!end
5067
5068 !! test
5069 Namespaced link must have a title (bad fragment version)
5070 !! input
5071 [[Project:#fragment]]
5072 !! result
5073 <p>[[Project:#fragment]]
5074 </p>
5075 !!end
5076
5077
5078 !! test
5079 div with no attributes
5080 !! input
5081 <div>HTML rocks</div>
5082 !! result
5083 <div>HTML rocks</div>
5084
5085 !! end
5086
5087 !! test
5088 div with double-quoted attribute
5089 !! input
5090 <div id="rock">HTML rocks</div>
5091 !! result
5092 <div id="rock">HTML rocks</div>
5093
5094 !! end
5095
5096 !! test
5097 div with single-quoted attribute
5098 !! input
5099 <div id='rock'>HTML rocks</div>
5100 !! result
5101 <div id="rock">HTML rocks</div>
5102
5103 !! end
5104
5105 !! test
5106 div with unquoted attribute
5107 !! input
5108 <div id=rock>HTML rocks</div>
5109 !! result
5110 <div id="rock">HTML rocks</div>
5111
5112 !! end
5113
5114 !! test
5115 div with illegal double attributes
5116 !! input
5117 <div id="a" id="b">HTML rocks</div>
5118 !! result
5119 <div id="b">HTML rocks</div>
5120
5121 !!end
5122
5123 !! test
5124 HTML multiple attributes correction
5125 !! input
5126 <p class="error" class="awesome">Awesome!</p>
5127 !! result
5128 <p class="awesome">Awesome!</p>
5129
5130 !!end
5131
5132 !! test
5133 Table multiple attributes correction
5134 !! input
5135 {|
5136 !+ class="error" class="awesome"| status
5137 |}
5138 !! result
5139 <table>
5140 <tr>
5141 <th class="awesome"> status
5142 </th></tr></table>
5143
5144 !!end
5145
5146 !! test
5147 DIV IN UPPERCASE
5148 !! input
5149 <DIV ID="x">HTML ROCKS</DIV>
5150 !! result
5151 <div id="x">HTML ROCKS</div>
5152
5153 !!end
5154
5155
5156 !! test
5157 text with amp in the middle of nowhere
5158 !! input
5159 Remember AT&T?
5160 !!result
5161 <p>Remember AT&amp;T?
5162 </p>
5163 !! end
5164
5165 !! test
5166 text with character entity: eacute
5167 !! input
5168 I always thought &eacute; was a cute letter.
5169 !! result
5170 <p>I always thought &#233; was a cute letter.
5171 </p>
5172 !! end
5173
5174 !! test
5175 text with undefined character entity: xacute
5176 !! input
5177 I always thought &xacute; was a cute letter.
5178 !! result
5179 <p>I always thought &amp;xacute; was a cute letter.
5180 </p>
5181 !! end
5182
5183
5184 ###
5185 ### Media links
5186 ###
5187
5188 !! test
5189 Media link
5190 !! input
5191 [[Media:Foobar.jpg]]
5192 !! result
5193 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Media:Foobar.jpg</a>
5194 </p>
5195 !! end
5196
5197 !! test
5198 Media link with text
5199 !! input
5200 [[Media:Foobar.jpg|A neat file to look at]]
5201 !! result
5202 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">A neat file to look at</a>
5203 </p>
5204 !! end
5205
5206 # FIXME: this is still bad HTML tag nesting
5207 !! test
5208 Media link with nasty text
5209 fixme: doBlockLevels won't wrap this in a paragraph because it contains a div
5210 !! input
5211 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
5212 !! result
5213 <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link&lt;div style="display:none"&gt;" onmouseover="alert(document.cookie)" onfoo="&lt;/div&gt;</a>
5214
5215 !! end
5216
5217 !! test
5218 Media link to nonexistent file (bug 1702)
5219 !! input
5220 [[Media:No such.jpg]]
5221 !! result
5222 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
5223 </p>
5224 !! end
5225
5226 !! test
5227 Image link to nonexistent file (bug 1850 - good)
5228 !! input
5229 [[Image:No such.jpg]]
5230 !! result
5231 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
5232 </p>
5233 !! end
5234
5235 !! test
5236 :Image link to nonexistent file (bug 1850 - bad)
5237 !! input
5238 [[:Image:No such.jpg]]
5239 !! result
5240 <p><a href="/index.php?title=File:No_such.jpg&amp;action=edit&amp;redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a>
5241 </p>
5242 !! end
5243
5244
5245
5246 !! test
5247 Character reference normalization in link text (bug 1938)
5248 !! input
5249 [[Main Page|this&that]]
5250 !! result
5251 <p><a href="/wiki/Main_Page" title="Main Page">this&amp;that</a>
5252 </p>
5253 !!end
5254
5255 !! article
5256 אַ
5257 !! text
5258 Test for unicode normalization
5259
5260 The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E
5261 !! endarticle
5262
5263 !! test
5264 (bug 19451) Links should refer to the normalized form.
5265 !! input
5266 [[&#xFB2E;]]
5267 [[&#x5d0;&#x5b7;]]
5268 [[&#x5d0;ַ]]
5269 [[א&#x5b7;]]
5270 [[אַ]]
5271 !! result
5272 <p><a href="/wiki/%D7%90%D6%B7" title="אַ">&#xfb2e;</a>
5273 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;&#x5b7;</a>
5274 <a href="/wiki/%D7%90%D6%B7" title="אַ">&#x5d0;ַ</a>
5275 <a href="/wiki/%D7%90%D6%B7" title="אַ">א&#x5b7;</a>
5276 <a href="/wiki/%D7%90%D6%B7" title="אַ">אַ</a>
5277 </p>
5278 !! end
5279
5280 !! test
5281 Empty attribute crash test (bug 2067)
5282 !! input
5283 <font color="">foo</font>
5284 !! result
5285 <p><font color="">foo</font>
5286 </p>
5287 !! end
5288
5289 !! test
5290 Empty attribute crash test single-quotes (bug 2067)
5291 !! input
5292 <font color=''>foo</font>
5293 !! result
5294 <p><font color="">foo</font>
5295 </p>
5296 !! end
5297
5298 !! test
5299 Attribute test: equals, then nothing
5300 !! input
5301 <font color=>foo</font>
5302 !! result
5303 <p><font>foo</font>
5304 </p>
5305 !! end
5306
5307 !! test
5308 Attribute test: unquoted value
5309 !! input
5310 <font color=x>foo</font>
5311 !! result
5312 <p><font color="x">foo</font>
5313 </p>
5314 !! end
5315
5316 !! test
5317 Attribute test: unquoted but illegal value (hash)
5318 !! input
5319 <font color=#x>foo</font>
5320 !! result
5321 <p><font color="#x">foo</font>
5322 </p>
5323 !! end
5324
5325 !! test
5326 Attribute test: no value
5327 !! input
5328 <font color>foo</font>
5329 !! result
5330 <p><font color="color">foo</font>
5331 </p>
5332 !! end
5333
5334 !! test
5335 Bug 2095: link with three closing brackets
5336 !! input
5337 [[Main Page]]]
5338 !! result
5339 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
5340 </p>
5341 !! end
5342
5343 !! test
5344 Bug 2095: link with pipe and three closing brackets
5345 !! input
5346 [[Main Page|link]]]
5347 !! result
5348 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
5349 </p>
5350 !! end
5351
5352 !! test
5353 Bug 2095: link with pipe and three closing brackets, version 2
5354 !! input
5355 [[Main Page|[http://example.com/]]]
5356 !! result
5357 <p><a href="/wiki/Main_Page" title="Main Page">[http://example.com/]</a>
5358 </p>
5359 !! end
5360
5361
5362 ###
5363 ### Safety
5364 ###
5365
5366 !! article
5367 Template:Dangerous attribute
5368 !! text
5369 " onmouseover="alert(document.cookie)
5370 !! endarticle
5371
5372 !! article
5373 Template:Dangerous style attribute
5374 !! text
5375 border-size: expression(alert(document.cookie))
5376 !! endarticle
5377
5378 !! article
5379 Template:Div style
5380 !! text
5381 <div style="float: right; {{{1}}}">Magic div</div>
5382 !! endarticle
5383
5384 !! test
5385 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
5386 !! input
5387 <div title="{{test}}"></div>
5388 !! result
5389 <div title="This is a test template"></div>
5390
5391 !! end
5392
5393 !! test
5394 Bug 2304: HTML attribute safety (dangerous template; 2309)
5395 !! input
5396 <div title="{{dangerous attribute}}"></div>
5397 !! result
5398 <div title=""></div>
5399
5400 !! end
5401
5402 !! test
5403 Bug 2304: HTML attribute safety (dangerous style template; 2309)
5404 !! input
5405 <div style="{{dangerous style attribute}}"></div>
5406 !! result
5407 <div style="/* insecure input */"></div>
5408
5409 !! end
5410
5411 !! test
5412 Bug 2304: HTML attribute safety (safe parameter; 2309)
5413 !! input
5414 {{div style|width: 200px}}
5415 !! result
5416 <div style="float: right; width: 200px">Magic div</div>
5417
5418 !! end
5419
5420 !! test
5421 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
5422 !! input
5423 {{div style|width: expression(alert(document.cookie))}}
5424 !! result
5425 <div style="/* insecure input */">Magic div</div>
5426
5427 !! end
5428
5429 !! test
5430 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
5431 !! input
5432 {{div style|"><script>alert(document.cookie)</script>}}
5433 !! result
5434 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
5435
5436 !! end
5437
5438 !! test
5439 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
5440 !! input
5441 {{div style|" ><script>alert(document.cookie)</script>}}
5442 !! result
5443 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
5444
5445 !! end
5446
5447 !! test
5448 Bug 2304: HTML attribute safety (link)
5449 !! input
5450 <div title="[[Main Page]]"></div>
5451 !! result
5452 <div title="&#91;&#91;Main Page]]"></div>
5453
5454 !! end
5455
5456 !! test
5457 Bug 2304: HTML attribute safety (italics)
5458 !! input
5459 <div title="''foobar''"></div>
5460 !! result
5461 <div title="&#39;&#39;foobar&#39;&#39;"></div>
5462
5463 !! end
5464
5465 !! test
5466 Bug 2304: HTML attribute safety (bold)
5467 !! input
5468 <div title="'''foobar'''"></div>
5469 !! result
5470 <div title="&#39;&#39;&#39;foobar&#39;&#39;&#39;"></div>
5471
5472 !! end
5473
5474
5475 !! test
5476 Bug 2304: HTML attribute safety (ISBN)
5477 !! input
5478 <div title="ISBN 1234567890"></div>
5479 !! result
5480 <div title="&#73;SBN 1234567890"></div>
5481
5482 !! end
5483
5484 !! test
5485 Bug 2304: HTML attribute safety (RFC)
5486 !! input
5487 <div title="RFC 1234"></div>
5488 !! result
5489 <div title="&#82;FC 1234"></div>
5490
5491 !! end
5492
5493 !! test
5494 Bug 2304: HTML attribute safety (PMID)
5495 !! input
5496 <div title="PMID 1234567890"></div>
5497 !! result
5498 <div title="&#80;MID 1234567890"></div>
5499
5500 !! end
5501
5502 !! test
5503 Bug 2304: HTML attribute safety (web link)
5504 !! input
5505 <div title="http://example.com/"></div>
5506 !! result
5507 <div title="http&#58;//example.com/"></div>
5508
5509 !! end
5510
5511 !! test
5512 Bug 2304: HTML attribute safety (named web link)
5513 !! input
5514 <div title="[http://example.com/ link]"></div>
5515 !! result
5516 <div title="&#91;http&#58;//example.com/ link]"></div>
5517
5518 !! end
5519
5520 !! test
5521 Bug 3244: HTML attribute safety (extension; safe)
5522 !! input
5523 <div style="<nowiki>background:blue</nowiki>"></div>
5524 !! result
5525 <div style="background:blue"></div>
5526
5527 !! end
5528
5529 !! test
5530 Bug 3244: HTML attribute safety (extension; unsafe)
5531 !! input
5532 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
5533 !! result
5534 <div style="/* insecure input */"></div>
5535
5536 !! end
5537
5538 # More MSIE fun discovered by Tom Gilder
5539
5540 !! test
5541 MSIE CSS safety test: spurious slash
5542 !! input
5543 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
5544 !! result
5545 <div style="/* insecure input */">evil</div>
5546
5547 !! end
5548
5549 !! test
5550 MSIE CSS safety test: hex code
5551 !! input
5552 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
5553 !! result
5554 <div style="/* insecure input */">evil</div>
5555
5556 !! end
5557
5558 !! test
5559 MSIE CSS safety test: comment in url
5560 !! input
5561 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
5562 !! result
5563 <div style="background-image:u rl(javascript:alert(&#39;boo&#39;))">evil</div>
5564
5565 !! end
5566
5567 !! test
5568 MSIE CSS safety test: comment in expression
5569 !! input
5570 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
5571 !! result
5572 <div style="background-image:expres sion(alert(&#39;boo4&#39;))">evil4</div>
5573
5574 !! end
5575
5576
5577 !! test
5578 Table attribute legitimate extension
5579 !! input
5580 {|
5581 !+ style="<nowiki>color:blue</nowiki>"| status
5582 |}
5583 !! result
5584 <table>
5585 <tr>
5586 <th style="color:blue"> status
5587 </th></tr></table>
5588
5589 !!end
5590
5591 !! test
5592 Table attribute safety
5593 !! input
5594 {|
5595 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
5596 |}
5597 !! result
5598 <table>
5599 <tr>
5600 <th style="/* insecure input */"> status
5601 </th></tr></table>
5602
5603 !! end
5604
5605 !! test
5606 CSS line continuation 1
5607 !! input
5608 <div style="background-image: u\&#10;rl(test.jpg);"></div>
5609 !! result
5610 <div style="/* insecure input */"></div>
5611
5612 !! end
5613
5614 !! test
5615 CSS line continuation 2
5616 !! input
5617 <div style="background-image: u\&#13;rl(test.jpg); "></div>
5618 !! result
5619 <div style="/* insecure input */"></div>
5620
5621 !! end
5622
5623 !! article
5624 Template:Identity
5625 !! text
5626 {{{1}}}
5627 !! endarticle
5628
5629 !! test
5630 Expansion of multi-line templates in attribute values (bug 6255)
5631 !! input
5632 <div style="background: {{identity|#00FF00}}">-</div>
5633 !! result
5634 <div style="background: #00FF00">-</div>
5635
5636 !! end
5637
5638
5639 !! test
5640 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
5641 !! input
5642 <div style="background:
5643 #00FF00">-</div>
5644 !! result
5645 <div style="background: #00FF00">-</div>
5646
5647 !! end
5648
5649 !! test
5650 Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
5651 !! input
5652 <div style="background: &#10;#00FF00">-</div>
5653 !! result
5654 <div style="background: &#10;#00FF00">-</div>
5655
5656 !! end
5657
5658 ###
5659 ### Parser hooks (see maintenance/parserTestsParserHook.php for the <tag> extension)
5660 ###
5661 !! test
5662 Parser hook: empty input
5663 !! input
5664 <tag></tag>
5665 !! result
5666 <pre>
5667 string(0) ""
5668 array(0) {
5669 }
5670 </pre>
5671
5672 !! end
5673
5674 !! test
5675 Parser hook: empty input using terminated empty elements
5676 !! input
5677 <tag/>
5678 !! result
5679 <pre>
5680 NULL
5681 array(0) {
5682 }
5683 </pre>
5684
5685 !! end
5686
5687 !! test
5688 Parser hook: empty input using terminated empty elements (space before)
5689 !! input
5690 <tag />
5691 !! result
5692 <pre>
5693 NULL
5694 array(0) {
5695 }
5696 </pre>
5697
5698 !! end
5699
5700 !! test
5701 Parser hook: basic input
5702 !! input
5703 <tag>input</tag>
5704 !! result
5705 <pre>
5706 string(5) "input"
5707 array(0) {
5708 }
5709 </pre>
5710
5711 !! end
5712
5713
5714 !! test
5715 Parser hook: case insensitive
5716 !! input
5717 <TAG>input</TAG>
5718 !! result
5719 <pre>
5720 string(5) "input"
5721 array(0) {
5722 }
5723 </pre>
5724
5725 !! end
5726
5727
5728 !! test
5729 Parser hook: case insensitive, redux
5730 !! input
5731 <TaG>input</TAg>
5732 !! result
5733 <pre>
5734 string(5) "input"
5735 array(0) {
5736 }
5737 </pre>
5738
5739 !! end
5740
5741 !! test
5742 Parser hook: nested tags
5743 !! options
5744 noxml
5745 !! input
5746 <tag><tag></tag></tag>
5747 !! result
5748 <pre>
5749 string(5) "<tag>"
5750 array(0) {
5751 }
5752 </pre>&lt;/tag&gt;
5753
5754 !! end
5755
5756 !! test
5757 Parser hook: basic arguments
5758 !! input
5759 <tag width=200 height = "100" depth = '50' square></tag>
5760 !! result
5761 <pre>
5762 string(0) ""
5763 array(4) {
5764 ["width"]=>
5765 string(3) "200"
5766 ["height"]=>
5767 string(3) "100"
5768 ["depth"]=>
5769 string(2) "50"
5770 ["square"]=>
5771 string(6) "square"
5772 }
5773 </pre>
5774
5775 !! end
5776
5777 !! test
5778 Parser hook: argument containing a forward slash (bug 5344)
5779 !! input
5780 <tag filename='/tmp/bla'></tag>
5781 !! result
5782 <pre>
5783 string(0) ""
5784 array(1) {
5785 ["filename"]=>
5786 string(8) "/tmp/bla"
5787 }
5788 </pre>
5789
5790 !! end
5791
5792 !! test
5793 Parser hook: empty input using terminated empty elements (bug 2374)
5794 !! input
5795 <tag foo=bar/>text
5796 !! result
5797 <pre>
5798 NULL
5799 array(1) {
5800 ["foo"]=>
5801 string(3) "bar"
5802 }
5803 </pre>text
5804
5805 !! end
5806
5807 # </tag> should be output literally since there is no matching tag that begins it
5808 !! test
5809 Parser hook: basic arguments using terminated empty elements (bug 2374)
5810 !! input
5811 <tag width=200 height = "100" depth = '50' square/>
5812 other stuff
5813 </tag>
5814 !! result
5815 <pre>
5816 NULL
5817 array(4) {
5818 ["width"]=>
5819 string(3) "200"
5820 ["height"]=>
5821 string(3) "100"
5822 ["depth"]=>
5823 string(2) "50"
5824 ["square"]=>
5825 string(6) "square"
5826 }
5827 </pre>
5828 <p>other stuff
5829 &lt;/tag&gt;
5830 </p>
5831 !! end
5832
5833 ###
5834 ### (see maintenance/parserTestsStaticParserHook.php for the <statictag> extension)
5835 ###
5836
5837 !! test
5838 Parser hook: static parser hook not inside a comment
5839 !! input
5840 <statictag>hello, world</statictag>
5841 <statictag action=flush/>
5842 !! result
5843 <p>hello, world
5844 </p>
5845 !! end
5846
5847
5848 !! test
5849 Parser hook: static parser hook inside a comment
5850 !! input
5851 <!-- <statictag>hello, world</statictag> -->
5852 <statictag action=flush/>
5853 !! result
5854 <p><br />
5855 </p>
5856 !! end
5857
5858 # Nested template calls; this case was broken by Parser.php rev 1.506,
5859 # since reverted.
5860
5861 !! article
5862 Template:One-parameter
5863 !! text
5864 (My parameter is: {{{1}}})
5865 !! endarticle
5866
5867 !! article
5868 Template:Map-one-parameter
5869 !! text
5870 {{{{{1}}}|{{{2}}}}}
5871 !! endarticle
5872
5873 !! test
5874 Nested template calls
5875 !! input
5876 {{Map-one-parameter|One-parameter|param}}
5877 !! result
5878 <p>(My parameter is: param)
5879 </p>
5880 !! end
5881
5882
5883 ###
5884 ### Sanitizer
5885 ###
5886 !! test
5887 Sanitizer: Closing of open tags
5888 !! input
5889 <s></s><table></table>
5890 !! result
5891 <s></s><table></table>
5892
5893 !! end
5894
5895 !! test
5896 Sanitizer: Closing of open but not closed tags
5897 !! input
5898 <s>foo
5899 !! result
5900 <p><s>foo</s>
5901 </p>
5902 !! end
5903
5904 !! test
5905 Sanitizer: Closing of closed but not open tags
5906 !! input
5907 </s>
5908 !! result
5909 <p>&lt;/s&gt;
5910 </p>
5911 !! end
5912
5913 !! test
5914 Sanitizer: Closing of closed but not open table tags
5915 !! input
5916 Table not started</td></tr></table>
5917 !! result
5918 <p>Table not started&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
5919 </p>
5920 !! end
5921
5922 !! test
5923 Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
5924 !! input
5925 <span id="æ: v">byte</span>[[#æ: v|backlink]]
5926 !! result
5927 <p><span id=".C3.A6:_v">byte</span><a href="#.C3.A6:_v">backlink</a>
5928 </p>
5929 !! end
5930
5931 !! test
5932 Sanitizer: Validating the contents of the id attribute (bug 4515)
5933 !! options
5934 disabled
5935 !! input
5936 <br id=9 />
5937 !! result
5938 Something, but definitely not <br id="9" />...
5939 !! end
5940
5941 !! test
5942 Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301)
5943 !! options
5944 disabled
5945 !! input
5946 <br id="foo" /><br id="foo" />
5947 !! result
5948 Something need to be done. foo-2 ?
5949 !! end
5950
5951 !! test
5952 Language converter: output gets cut off unexpectedly (bug 5757)
5953 !! options
5954 language=zh
5955 !! input
5956 this bit is safe: }-
5957
5958 but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
5959
5960 then we get cut off here: }-
5961
5962 all additional text is vanished
5963 !! result
5964 <p>this bit is safe: }-
5965 </p><p>but if we add a conversion instance: xxx
5966 </p><p>then we get cut off here: }-
5967 </p><p>all additional text is vanished
5968 </p>
5969 !! end
5970
5971 !! test
5972 Self closed html pairs (bug 5487)
5973 !! options
5974 !! input
5975 <center><font id="bug" />Centered text</center>
5976 <div><font id="bug2" />In div text</div>
5977 !! result
5978 <center>&lt;font id="bug" /&gt;Centered text</center>
5979 <div>&lt;font id="bug2" /&gt;In div text</div>
5980
5981 !! end
5982
5983 #
5984 #
5985 #
5986
5987 !! test
5988 Punctuation: nbsp before exclamation
5989 !! input
5990 C'est grave !
5991 !! result
5992 <p>C'est grave&#160;!
5993 </p>
5994 !! end
5995
5996 !! test
5997 Punctuation: CSS !important (bug 11874)
5998 !! input
5999 <div style="width:50% !important">important</div>
6000 !! result
6001 <div style="width:50% !important">important</div>
6002
6003 !!end
6004
6005 !! test
6006 Punctuation: CSS ! important (bug 11874; with space after)
6007 !! input
6008 <div style="width:50% ! important">important</div>
6009 !! result
6010 <div style="width:50% ! important">important</div>
6011
6012 !!end
6013
6014
6015 !! test
6016 HTML bullet list, closed tags (bug 5497)
6017 !! input
6018 <ul>
6019 <li>One</li>
6020 <li>Two</li>
6021 </ul>
6022 !! result
6023 <ul>
6024 <li>One</li>
6025 <li>Two</li>
6026 </ul>
6027
6028 !! end
6029
6030 !! test
6031 HTML bullet list, unclosed tags (bug 5497)
6032 !! options
6033 disabled
6034 !! input
6035 <ul>
6036 <li>One
6037 <li>Two
6038 </ul>
6039 !! result
6040 <ul>
6041 <li>One
6042 </li><li>Two
6043 </li></ul>
6044
6045 !! end
6046
6047 !! test
6048 HTML ordered list, closed tags (bug 5497)
6049 !! input
6050 <ol>
6051 <li>One</li>
6052 <li>Two</li>
6053 </ol>
6054 !! result
6055 <ol>
6056 <li>One</li>
6057 <li>Two</li>
6058 </ol>
6059
6060 !! end
6061
6062 !! test
6063 HTML ordered list, unclosed tags (bug 5497)
6064 !! options
6065 disabled
6066 !! input
6067 <ol>
6068 <li>One
6069 <li>Two
6070 </ol>
6071 !! result
6072 <ol>
6073 <li>One
6074 </li><li>Two
6075 </li></ol>
6076
6077 !! end
6078
6079 !! test
6080 HTML nested bullet list, closed tags (bug 5497)
6081 !! input
6082 <ul>
6083 <li>One</li>
6084 <li>Two:
6085 <ul>
6086 <li>Sub-one</li>
6087 <li>Sub-two</li>
6088 </ul>
6089 </li>
6090 </ul>
6091 !! result
6092 <ul>
6093 <li>One</li>
6094 <li>Two:
6095 <ul>
6096 <li>Sub-one</li>
6097 <li>Sub-two</li>
6098 </ul>
6099 </li>
6100 </ul>
6101
6102 !! end
6103
6104 !! test
6105 HTML nested bullet list, open tags (bug 5497)
6106 !! options
6107 disabled
6108 !! input
6109 <ul>
6110 <li>One
6111 <li>Two:
6112 <ul>
6113 <li>Sub-one
6114 <li>Sub-two
6115 </ul>
6116 </ul>
6117 !! result
6118 <ul>
6119 <li>One
6120 </li><li>Two:
6121 <ul>
6122 <li>Sub-one
6123 </li><li>Sub-two
6124 </li></ul>
6125 </li></ul>
6126
6127 !! end
6128
6129 !! test
6130 HTML nested ordered list, closed tags (bug 5497)
6131 !! input
6132 <ol>
6133 <li>One</li>
6134 <li>Two:
6135 <ol>
6136 <li>Sub-one</li>
6137 <li>Sub-two</li>
6138 </ol>
6139 </li>
6140 </ol>
6141 !! result
6142 <ol>
6143 <li>One</li>
6144 <li>Two:
6145 <ol>
6146 <li>Sub-one</li>
6147 <li>Sub-two</li>
6148 </ol>
6149 </li>
6150 </ol>
6151
6152 !! end
6153
6154 !! test
6155 HTML nested ordered list, open tags (bug 5497)
6156 !! options
6157 disabled
6158 !! input
6159 <ol>
6160 <li>One
6161 <li>Two:
6162 <ol>
6163 <li>Sub-one
6164 <li>Sub-two
6165 </ol>
6166 </ol>
6167 !! result
6168 <ol>
6169 <li>One
6170 </li><li>Two:
6171 <ol>
6172 <li>Sub-one
6173 </li><li>Sub-two
6174 </li></ol>
6175 </li></ol>
6176
6177 !! end
6178
6179 !! test
6180 HTML ordered list item with parameters oddity
6181 !! input
6182 <ol><li id="fragment">One</li></ol>
6183 !! result
6184 <ol><li id="fragment">One</li></ol>
6185
6186 !! end
6187
6188 !!test
6189 bug 5918: autonumbering
6190 !! input
6191 [http://first/] [http://second] [ftp://ftp]
6192
6193 ftp://inlineftp
6194
6195 [mailto:enclosed@mail.tld With target]
6196
6197 [mailto:enclosed@mail.tld]
6198
6199 mailto:inline@mail.tld
6200 !! result
6201 <p><a rel="nofollow" class="external autonumber" href="http://first/">[1]</a> <a rel="nofollow" class="external autonumber" href="http://second">[2]</a> <a rel="nofollow" class="external autonumber" href="ftp://ftp">[3]</a>
6202 </p><p><a rel="nofollow" class="external free" href="ftp://inlineftp">ftp://inlineftp</a>
6203 </p><p><a rel="nofollow" class="external text" href="mailto:enclosed@mail.tld">With target</a>
6204 </p><p><a rel="nofollow" class="external autonumber" href="mailto:enclosed@mail.tld">[4]</a>
6205 </p><p><a rel="nofollow" class="external free" href="mailto:inline@mail.tld">mailto:inline@mail.tld</a>
6206 </p>
6207 !! end
6208
6209
6210 #
6211 # Security and HTML correctness
6212 # From Nick Jenkins' fuzz testing
6213 #
6214
6215 !! test
6216 Fuzz testing: Parser13
6217 !! input
6218 {|
6219 | http://a|
6220 !! result
6221 <table>
6222 <tr>
6223 <td>
6224 </td>
6225 </tr>
6226 </table>
6227
6228 !! end
6229
6230 !! test
6231 Fuzz testing: Parser14
6232 !! input
6233 == onmouseover= ==
6234 http://__TOC__
6235 !! result
6236 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline" id="onmouseover.3D"> onmouseover= </span></h2>
6237 http://<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
6238 <ul>
6239 <li class="toclevel-1 tocsection-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
6240 </ul>
6241 </td></tr></table>
6242
6243 !! end
6244
6245 !! test
6246 Fuzz testing: Parser14-table
6247 !! input
6248 ==a==
6249 {| STYLE=__TOC__
6250 !! result
6251 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline" id="a">a</span></h2>
6252 <table style="&#95;_TOC&#95;_">
6253 <tr><td></td></tr>
6254 </table>
6255
6256 !! end
6257
6258 # Known to produce bogus xml (extra </td>)
6259 !! test
6260 Fuzz testing: Parser16
6261 !! options
6262 noxml
6263 !! input
6264 {|
6265 !https://||||||
6266 !! result
6267 <table>
6268 <tr>
6269 <th>https://</th>
6270 <th></th>
6271 <th></th>
6272 <th>
6273 </td>
6274 </tr>
6275 </table>
6276
6277 !! end
6278
6279 !! test
6280 Fuzz testing: Parser21
6281 !! input
6282 {|
6283 ! irc://{{ftp://a" onmouseover="alert('hello world');"
6284 |
6285 !! result
6286 <table>
6287 <tr>
6288 <th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
6289 </th>
6290 <td>
6291 </td>
6292 </tr>
6293 </table>
6294
6295 !! end
6296
6297 !! test
6298 Fuzz testing: Parser22
6299 !! input
6300 http://===r:::https://b
6301
6302 {|
6303 !!result
6304 <p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a>
6305 </p>
6306 <table>
6307 <tr><td></td></tr>
6308 </table>
6309
6310 !! end
6311
6312 # Known to produce bad XML for now
6313 !! test
6314 Fuzz testing: Parser24
6315 !! options
6316 noxml
6317 !! input
6318 {|
6319 {{{|
6320 <u CLASS=
6321 | {{{{SSSll!!!!!!!VVVV)]]][[Special:*xxxxxxx--><noinclude>}}}} >
6322 <br style="onmouseover='alert(document.cookie);' " />
6323
6324 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
6325 |
6326 !! result
6327 <table>
6328 {{{|
6329 <u class="&#124;">}}}} &gt;
6330 <br style="onmouseover=&#39;alert(document.cookie);&#39;" />
6331
6332 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
6333 <tr>
6334 <td></u>
6335 </td>
6336 </tr>
6337 </table>
6338
6339 !! end
6340
6341 # Note: the current result listed for this is not what the original one was,
6342 # but the original bug was JavaScript injection, which is fixed in any case.
6343 # It's not clear that the original result listed was any more correct than the
6344 # current one. Original result:
6345 # <p>{{{|
6346 # </p>
6347 # <li class="&#124;&#124;">
6348 # }}}blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
6349 !!test
6350 Fuzz testing: Parser25 (bug 6055)
6351 !! input
6352 {{{
6353 |
6354 <LI CLASS=||
6355 >
6356 }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE
6357 !! result
6358 <p>&lt;LI CLASS=blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
6359 </p>
6360 !! end
6361
6362 !!test
6363 Fuzz testing: URL adjacent extension (with space, clean)
6364 !! options
6365 !! input
6366 http://example.com <nowiki>junk</nowiki>
6367 !! result
6368 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> junk
6369 </p>
6370 !!end
6371
6372 !!test
6373 Fuzz testing: URL adjacent extension (no space, dirty; nowiki)
6374 !! options
6375 !! input
6376 http://example.com<nowiki>junk</nowiki>
6377 !! result
6378 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>junk
6379 </p>
6380 !!end
6381
6382 !!test
6383 Fuzz testing: URL adjacent extension (no space, dirty; pre)
6384 !! options
6385 !! input
6386 http://example.com<pre>junk</pre>
6387 !! result
6388 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
6389
6390 !!end
6391
6392 !!test
6393 Fuzz testing: image with bogus manual thumbnail
6394 !!input
6395 [[Image:foobar.jpg|thumbnail= ]]
6396 !!result
6397 <div class="thumb tright"><div class="thumbinner" style="width:1943px;">Error creating thumbnail: <div class="thumbcaption"></div></div></div>
6398
6399 !!end
6400
6401 !! test
6402 Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
6403 !! input
6404 <pre dir="&#10;"></pre>
6405 !! result
6406 <pre dir="&#10;"></pre>
6407
6408 !! end
6409
6410 !! test
6411 Parsing optional HTML elements (Bug 6171)
6412 !! options
6413 !! input
6414 <table>
6415 <tr>
6416 <td> Some tabular data</td>
6417 <td> More tabular data ...
6418 <td> And yet som tabular data</td>
6419 </tr>
6420 </table>
6421 !! result
6422 <table>
6423 <tr>
6424 <td> Some tabular data</td>
6425 <td> More tabular data ...
6426 </td><td> And yet som tabular data</td>
6427 </tr>
6428 </table>
6429
6430 !! end
6431
6432 !! test
6433 Correct handling of <td>, <tr> (Bug 6171)
6434 !! options
6435 !! input
6436 <table>
6437 <tr>
6438 <td> Some tabular data</td>
6439 <td> More tabular data ...</td>
6440 <td> And yet som tabular data</td>
6441 </tr>
6442 </table>
6443 !! result
6444 <table>
6445 <tr>
6446 <td> Some tabular data</td>
6447 <td> More tabular data ...</td>
6448 <td> And yet som tabular data</td>
6449 </tr>
6450 </table>
6451
6452 !! end
6453
6454
6455 !! test
6456 Parsing crashing regression (fr:JavaScript)
6457 !! input
6458 </body></x>
6459 !! result
6460 <p>&lt;/body&gt;&lt;/x&gt;
6461 </p>
6462 !! end
6463
6464 !! test
6465 Inline wiki vs wiki block nesting
6466 !! input
6467 '''Bold paragraph
6468
6469 New wiki paragraph
6470 !! result
6471 <p><b>Bold paragraph</b>
6472 </p><p>New wiki paragraph
6473 </p>
6474 !! end
6475
6476 !! test
6477 Inline HTML vs wiki block nesting
6478 !! options
6479 disabled
6480 !! input
6481 <b>Bold paragraph
6482
6483 New wiki paragraph
6484 !! result
6485 <p><b>Bold paragraph</b>
6486 </p><p>New wiki paragraph
6487 </p>
6488 !! end
6489
6490 # Original result was this:
6491 # <p><b>bold</b><b>bold<i>bolditalics</i></b>
6492 # </p>
6493 # While that might be marginally more intuitive, maybe, the six-apostrophe
6494 # construct is clearly pathological and the result stated here (which is what
6495 # the parser actually does) is about as reasonable as anything.
6496 !!test
6497 Mixing markup for italics and bold
6498 !! options
6499 !! input
6500 '''bold''''''bold''bolditalics'''''
6501 !! result
6502 <p>'<i>bold'</i><b>bold<i>bolditalics</i></b>
6503 </p>
6504 !! end
6505
6506
6507 !! article
6508 Xyzzyx
6509 !! text
6510 Article for special page transclusion test
6511 !! endarticle
6512
6513 !! test
6514 Special page transclusion
6515 !! options
6516 !! input
6517 {{Special:Prefixindex/Xyzzyx}}
6518 !! result
6519 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
6520
6521 !! end
6522
6523 !! test
6524 Special page transclusion twice (bug 5021)
6525 !! options
6526 !! input
6527 {{Special:Prefixindex/Xyzzyx}}
6528 {{Special:Prefixindex/Xyzzyx}}
6529 !! result
6530 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
6531 <table border="0" id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
6532
6533 !! end
6534
6535 !! test
6536 Transclusion of default MediaWiki message
6537 !! input
6538 {{MediaWiki:Mainpage}}
6539 !!result
6540 <p>Main Page
6541 </p>
6542 !! end
6543
6544 !! test
6545 Transclusion of nonexistent MediaWiki message
6546 !! input
6547 {{MediaWiki:Mainpagexxx}}
6548 !!result
6549 <p><a href="/index.php?title=MediaWiki:Mainpagexxx&amp;action=edit&amp;redlink=1" class="new" title="MediaWiki:Mainpagexxx (page does not exist)">MediaWiki:Mainpagexxx</a>
6550 </p>
6551 !! end
6552
6553 !! test
6554 Transclusion of MediaWiki message with underscore
6555 !! input
6556 {{MediaWiki:history_short}}
6557 !! result
6558 <p>History
6559 </p>
6560 !! end
6561
6562 !! test
6563 Transclusion of MediaWiki message with space
6564 !! input
6565 {{MediaWiki:history short}}
6566 !! result
6567 <p>History
6568 </p>
6569 !! end
6570
6571 !! test
6572 Invalid header with following text
6573 !! input
6574 = x = y
6575 !! result
6576 <p>= x = y
6577 </p>
6578 !! end
6579
6580
6581 !! test
6582 Section extraction test (section 0)
6583 !! options
6584 section=0
6585 !! input
6586 start
6587 ==a==
6588 ===aa===
6589 ====aaa====
6590 ==b==
6591 ===ba===
6592 ===bb===
6593 ====bba====
6594 ===bc===
6595 ==c==
6596 ===ca===
6597 !! result
6598 start
6599 !! end
6600
6601 !! test
6602 Section extraction test (section 1)
6603 !! options
6604 section=1
6605 !! input
6606 start
6607 ==a==
6608 ===aa===
6609 ====aaa====
6610 ==b==
6611 ===ba===
6612 ===bb===
6613 ====bba====
6614 ===bc===
6615 ==c==
6616 ===ca===
6617 !! result
6618 ==a==
6619 ===aa===
6620 ====aaa====
6621 !! end
6622
6623 !! test
6624 Section extraction test (section 2)
6625 !! options
6626 section=2
6627 !! input
6628 start
6629 ==a==
6630 ===aa===
6631 ====aaa====
6632 ==b==
6633 ===ba===
6634 ===bb===
6635 ====bba====
6636 ===bc===
6637 ==c==
6638 ===ca===
6639 !! result
6640 ===aa===
6641 ====aaa====
6642 !! end
6643
6644 !! test
6645 Section extraction test (section 3)
6646 !! options
6647 section=3
6648 !! input
6649 start
6650 ==a==
6651 ===aa===
6652 ====aaa====
6653 ==b==
6654 ===ba===
6655 ===bb===
6656 ====bba====
6657 ===bc===
6658 ==c==
6659 ===ca===
6660 !! result
6661 ====aaa====
6662 !! end
6663
6664 !! test
6665 Section extraction test (section 4)
6666 !! options
6667 section=4
6668 !! input
6669 start
6670 ==a==
6671 ===aa===
6672 ====aaa====
6673 ==b==
6674 ===ba===
6675 ===bb===
6676 ====bba====
6677 ===bc===
6678 ==c==
6679 ===ca===
6680 !! result
6681 ==b==
6682 ===ba===
6683 ===bb===
6684 ====bba====
6685 ===bc===
6686 !! end
6687
6688 !! test
6689 Section extraction test (section 5)
6690 !! options
6691 section=5
6692 !! input
6693 start
6694 ==a==
6695 ===aa===
6696 ====aaa====
6697 ==b==
6698 ===ba===
6699 ===bb===
6700 ====bba====
6701 ===bc===
6702 ==c==
6703 ===ca===
6704 !! result
6705 ===ba===
6706 !! end
6707
6708 !! test
6709 Section extraction test (section 6)
6710 !! options
6711 section=6
6712 !! input
6713 start
6714 ==a==
6715 ===aa===
6716 ====aaa====
6717 ==b==
6718 ===ba===
6719 ===bb===
6720 ====bba====
6721 ===bc===
6722 ==c==
6723 ===ca===
6724 !! result
6725 ===bb===
6726 ====bba====
6727 !! end
6728
6729 !! test
6730 Section extraction test (section 7)
6731 !! options
6732 section=7
6733 !! input
6734 start
6735 ==a==
6736 ===aa===
6737 ====aaa====
6738 ==b==
6739 ===ba===
6740 ===bb===
6741 ====bba====
6742 ===bc===
6743 ==c==
6744 ===ca===
6745 !! result
6746 ====bba====
6747 !! end
6748
6749 !! test
6750 Section extraction test (section 8)
6751 !! options
6752 section=8
6753 !! input
6754 start
6755 ==a==
6756 ===aa===
6757 ====aaa====
6758 ==b==
6759 ===ba===
6760 ===bb===
6761 ====bba====
6762 ===bc===
6763 ==c==
6764 ===ca===
6765 !! result
6766 ===bc===
6767 !! end
6768
6769 !! test
6770 Section extraction test (section 9)
6771 !! options
6772 section=9
6773 !! input
6774 start
6775 ==a==
6776 ===aa===
6777 ====aaa====
6778 ==b==
6779 ===ba===
6780 ===bb===
6781 ====bba====
6782 ===bc===
6783 ==c==
6784 ===ca===
6785 !! result
6786 ==c==
6787 ===ca===
6788 !! end
6789
6790 !! test
6791 Section extraction test (section 10)
6792 !! options
6793 section=10
6794 !! input
6795 start
6796 ==a==
6797 ===aa===
6798 ====aaa====
6799 ==b==
6800 ===ba===
6801 ===bb===
6802 ====bba====
6803 ===bc===
6804 ==c==
6805 ===ca===
6806 !! result
6807 ===ca===
6808 !! end
6809
6810 !! test
6811 Section extraction test (nonexistent section 11)
6812 !! options
6813 section=11
6814 !! input
6815 start
6816 ==a==
6817 ===aa===
6818 ====aaa====
6819 ==b==
6820 ===ba===
6821 ===bb===
6822 ====bba====
6823 ===bc===
6824 ==c==
6825 ===ca===
6826 !! result
6827 !! end
6828
6829 !! test
6830 Section extraction test with bogus heading (section 1)
6831 !! options
6832 section=1
6833 !! input
6834 ==a==
6835 ==bogus== not a legal section
6836 ==b==
6837 !! result
6838 ==a==
6839 ==bogus== not a legal section
6840 !! end
6841
6842 !! test
6843 Section extraction test with bogus heading (section 2)
6844 !! options
6845 section=2
6846 !! input
6847 ==a==
6848 ==bogus== not a legal section
6849 ==b==
6850 !! result
6851 ==b==
6852 !! end
6853
6854 !! test
6855 Section extraction test with comment after heading (section 1)
6856 !! options
6857 section=1
6858 !! input
6859 ==a==
6860 ==b== <!-- -->
6861 ==c==
6862 !! result
6863 ==a==
6864 !! end
6865
6866 !! test
6867 Section extraction test with comment after heading (section 2)
6868 !! options
6869 section=2
6870 !! input
6871 ==a==
6872 ==b== <!-- -->
6873 ==c==
6874 !! result
6875 ==b== <!-- -->
6876 !! end
6877
6878 !! test
6879 Section extraction test with bogus <nowiki> heading (section 1)
6880 !! options
6881 section=1
6882 !! input
6883 ==a==
6884 ==bogus== <nowiki>not a legal section</nowiki>
6885 ==b==
6886 !! result
6887 ==a==
6888 ==bogus== <nowiki>not a legal section</nowiki>
6889 !! end
6890
6891 !! test
6892 Section extraction test with bogus <nowiki> heading (section 2)
6893 !! options
6894 section=2
6895 !! input
6896 ==a==
6897 ==bogus== <nowiki>not a legal section</nowiki>
6898 ==b==
6899 !! result
6900 ==b==
6901 !! end
6902
6903
6904 # Formerly testing for bug 2587, now resolved by the use of unmarked sections
6905 # instead of respecting commented sections
6906 !! test
6907 Section extraction prefixed by comment (section 1)
6908 !! options
6909 section=1
6910 !! input
6911 <!-- -->==sec1==
6912 ==sec2==
6913 !!result
6914 ==sec2==
6915 !!end
6916
6917 !! test
6918 Section extraction prefixed by comment (section 2)
6919 !! options
6920 section=2
6921 !! input
6922 <!-- -->==sec1==
6923 ==sec2==
6924 !!result
6925
6926 !!end
6927
6928
6929 # Formerly testing for bug 2607, now resolved by the use of unmarked sections
6930 # instead of respecting HTML-style headings
6931 !! test
6932 Section extraction, mixed wiki and html (section 1)
6933 !! options
6934 section=1
6935 !! input
6936 <h2>unmarked</h2>
6937 unmarked
6938 ==1==
6939 one
6940 ==2==
6941 two
6942 !! result
6943 ==1==
6944 one
6945 !! end
6946
6947 !! test
6948 Section extraction, mixed wiki and html (section 2)
6949 !! options
6950 section=2
6951 !! input
6952 <h2>unmarked</h2>
6953 unmarked
6954 ==1==
6955 one
6956 ==2==
6957 two
6958 !! result
6959 ==2==
6960 two
6961 !! end
6962
6963
6964 # Formerly testing for bug 3342
6965 !! test
6966 Section extraction, heading surrounded by <noinclude>
6967 !! options
6968 section=1
6969 !! input
6970 <noinclude>==unmarked==</noinclude>
6971 ==marked==
6972 !! result
6973 ==marked==
6974 !!end
6975
6976 # Test behaviour of bug 19910
6977 !! test
6978 Sectiion with all-equals
6979 !! options
6980 section=2
6981 !! input
6982 ===
6983 The line above must have a trailing space
6984 === <!--
6985 --> <!-- -->
6986 But just in case it doesn't...
6987 !! result
6988 === <!--
6989 --> <!-- -->
6990 But just in case it doesn't...
6991 !! end
6992
6993 !! test
6994 Section replacement test (section 0)
6995 !! options
6996 replace=0,"xxx"
6997 !! input
6998 start
6999 ==a==
7000 ===aa===
7001 ====aaa====
7002 ==b==
7003 ===ba===
7004 ===bb===
7005 ====bba====
7006 ===bc===
7007 ==c==
7008 ===ca===
7009 !! result
7010 xxx
7011
7012 ==a==
7013 ===aa===
7014 ====aaa====
7015 ==b==
7016 ===ba===
7017 ===bb===
7018 ====bba====
7019 ===bc===
7020 ==c==
7021 ===ca===
7022 !! end
7023
7024 !! test
7025 Section replacement test (section 1)
7026 !! options
7027 replace=1,"xxx"
7028 !! input
7029 start
7030 ==a==
7031 ===aa===
7032 ====aaa====
7033 ==b==
7034 ===ba===
7035 ===bb===
7036 ====bba====
7037 ===bc===
7038 ==c==
7039 ===ca===
7040 !! result
7041 start
7042 xxx
7043
7044 ==b==
7045 ===ba===
7046 ===bb===
7047 ====bba====
7048 ===bc===
7049 ==c==
7050 ===ca===
7051 !! end
7052
7053 !! test
7054 Section replacement test (section 2)
7055 !! options
7056 replace=2,"xxx"
7057 !! input
7058 start
7059 ==a==
7060 ===aa===
7061 ====aaa====
7062 ==b==
7063 ===ba===
7064 ===bb===
7065 ====bba====
7066 ===bc===
7067 ==c==
7068 ===ca===
7069 !! result
7070 start
7071 ==a==
7072 xxx
7073
7074 ==b==
7075 ===ba===
7076 ===bb===
7077 ====bba====
7078 ===bc===
7079 ==c==
7080 ===ca===
7081 !! end
7082
7083 !! test
7084 Section replacement test (section 3)
7085 !! options
7086 replace=3,"xxx"
7087 !! input
7088 start
7089 ==a==
7090 ===aa===
7091 ====aaa====
7092 ==b==
7093 ===ba===
7094 ===bb===
7095 ====bba====
7096 ===bc===
7097 ==c==
7098 ===ca===
7099 !! result
7100 start
7101 ==a==
7102 ===aa===
7103 xxx
7104
7105 ==b==
7106 ===ba===
7107 ===bb===
7108 ====bba====
7109 ===bc===
7110 ==c==
7111 ===ca===
7112 !! end
7113
7114 !! test
7115 Section replacement test (section 4)
7116 !! options
7117 replace=4,"xxx"
7118 !! input
7119 start
7120 ==a==
7121 ===aa===
7122 ====aaa====
7123 ==b==
7124 ===ba===
7125 ===bb===
7126 ====bba====
7127 ===bc===
7128 ==c==
7129 ===ca===
7130 !! result
7131 start
7132 ==a==
7133 ===aa===
7134 ====aaa====
7135 xxx
7136
7137 ==c==
7138 ===ca===
7139 !! end
7140
7141 !! test
7142 Section replacement test (section 5)
7143 !! options
7144 replace=5,"xxx"
7145 !! input
7146 start
7147 ==a==
7148 ===aa===
7149 ====aaa====
7150 ==b==
7151 ===ba===
7152 ===bb===
7153 ====bba====
7154 ===bc===
7155 ==c==
7156 ===ca===
7157 !! result
7158 start
7159 ==a==
7160 ===aa===
7161 ====aaa====
7162 ==b==
7163 xxx
7164
7165 ===bb===
7166 ====bba====
7167 ===bc===
7168 ==c==
7169 ===ca===
7170 !! end
7171
7172 !! test
7173 Section replacement test (section 6)
7174 !! options
7175 replace=6,"xxx"
7176 !! input
7177 start
7178 ==a==
7179 ===aa===
7180 ====aaa====
7181 ==b==
7182 ===ba===
7183 ===bb===
7184 ====bba====
7185 ===bc===
7186 ==c==
7187 ===ca===
7188 !! result
7189 start
7190 ==a==
7191 ===aa===
7192 ====aaa====
7193 ==b==
7194 ===ba===
7195 xxx
7196
7197 ===bc===
7198 ==c==
7199 ===ca===
7200 !! end
7201
7202 !! test
7203 Section replacement test (section 7)
7204 !! options
7205 replace=7,"xxx"
7206 !! input
7207 start
7208 ==a==
7209 ===aa===
7210 ====aaa====
7211 ==b==
7212 ===ba===
7213 ===bb===
7214 ====bba====
7215 ===bc===
7216 ==c==
7217 ===ca===
7218 !! result
7219 start
7220 ==a==
7221 ===aa===
7222 ====aaa====
7223 ==b==
7224 ===ba===
7225 ===bb===
7226 xxx
7227
7228 ===bc===
7229 ==c==
7230 ===ca===
7231 !! end
7232
7233 !! test
7234 Section replacement test (section 8)
7235 !! options
7236 replace=8,"xxx"
7237 !! input
7238 start
7239 ==a==
7240 ===aa===
7241 ====aaa====
7242 ==b==
7243 ===ba===
7244 ===bb===
7245 ====bba====
7246 ===bc===
7247 ==c==
7248 ===ca===
7249 !! result
7250 start
7251 ==a==
7252 ===aa===
7253 ====aaa====
7254 ==b==
7255 ===ba===
7256 ===bb===
7257 ====bba====
7258 xxx
7259
7260 ==c==
7261 ===ca===
7262 !!end
7263
7264 !! test
7265 Section replacement test (section 9)
7266 !! options
7267 replace=9,"xxx"
7268 !! input
7269 start
7270 ==a==
7271 ===aa===
7272 ====aaa====
7273 ==b==
7274 ===ba===
7275 ===bb===
7276 ====bba====
7277 ===bc===
7278 ==c==
7279 ===ca===
7280 !! result
7281 start
7282 ==a==
7283 ===aa===
7284 ====aaa====
7285 ==b==
7286 ===ba===
7287 ===bb===
7288 ====bba====
7289 ===bc===
7290 xxx
7291 !! end
7292
7293 !! test
7294 Section replacement test (section 10)
7295 !! options
7296 replace=10,"xxx"
7297 !! input
7298 start
7299 ==a==
7300 ===aa===
7301 ====aaa====
7302 ==b==
7303 ===ba===
7304 ===bb===
7305 ====bba====
7306 ===bc===
7307 ==c==
7308 ===ca===
7309 !! result
7310 start
7311 ==a==
7312 ===aa===
7313 ====aaa====
7314 ==b==
7315 ===ba===
7316 ===bb===
7317 ====bba====
7318 ===bc===
7319 ==c==
7320 xxx
7321 !! end
7322
7323 !! test
7324 Section replacement test with initial whitespace (bug 13728)
7325 !! options
7326 replace=2,"xxx"
7327 !! input
7328 Preformatted initial line
7329 ==a==
7330 ===a===
7331 !! result
7332 Preformatted initial line
7333 ==a==
7334 xxx
7335 !! end
7336
7337
7338 !! test
7339 Section extraction, heading followed by pre with 20 spaces (bug 6398)
7340 !! options
7341 section=1
7342 !! input
7343 ==a==
7344 a
7345 !! result
7346 ==a==
7347 a
7348 !! end
7349
7350 !! test
7351 Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check)
7352 !! options
7353 section=1
7354 !! input
7355 ==a==
7356 a
7357 !! result
7358 ==a==
7359 a
7360 !! end
7361
7362
7363 !! test
7364 Section extraction, <pre> around bogus header (bug 10309)
7365 !! options
7366 noxml section=2
7367 !! input
7368 == Section One ==
7369 <pre>
7370 =======
7371 </pre>
7372
7373 == Section Two ==
7374 stuff
7375 !! result
7376 == Section Two ==
7377 stuff
7378 !! end
7379
7380 !! test
7381 Section replacement, <pre> around bogus header (bug 10309)
7382 !! options
7383 noxml replace=2,"xxx"
7384 !! input
7385 == Section One ==
7386 <pre>
7387 =======
7388 </pre>
7389
7390 == Section Two ==
7391 stuff
7392 !! result
7393 == Section One ==
7394 <pre>
7395 =======
7396 </pre>
7397
7398 xxx
7399 !! end
7400
7401
7402
7403 !! test
7404 Handling of &#x0A; in URLs
7405 !! input
7406 **irc://&#x0A;a
7407 !! result
7408 <ul><li><ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a>
7409 </li></ul>
7410 </li></ul>
7411
7412 !!end
7413
7414 !! test
7415 5 quotes, code coverage +1 line
7416 !! input
7417 '''''
7418 !! result
7419 !! end
7420
7421 !! test
7422 Special:Search page linking.
7423 !! input
7424 {{Special:search}}
7425 !! result
7426 <p><a href="/wiki/Special:Search" title="Special:Search">Special:Search</a>
7427 </p>
7428 !! end
7429
7430 !! test
7431 Say the magic word
7432 !! input
7433 * {{PAGENAME}}
7434 * {{BASEPAGENAME}}
7435 * {{SUBPAGENAME}}
7436 * {{SUBPAGENAMEE}}
7437 * {{BASEPAGENAME}}
7438 * {{BASEPAGENAMEE}}
7439 * {{TALKPAGENAME}}
7440 * {{TALKPAGENAMEE}}
7441 * {{SUBJECTPAGENAME}}
7442 * {{SUBJECTPAGENAMEE}}
7443 * {{NAMESPACEE}}
7444 * {{NAMESPACE}}
7445 * {{TALKSPACE}}
7446 * {{TALKSPACEE}}
7447 * {{SUBJECTSPACE}}
7448 * {{SUBJECTSPACEE}}
7449 * {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
7450 !! result
7451 <ul><li> Parser test
7452 </li><li> Parser test
7453 </li><li> Parser test
7454 </li><li> Parser_test
7455 </li><li> Parser test
7456 </li><li> Parser_test
7457 </li><li> Talk:Parser test
7458 </li><li> Talk:Parser_test
7459 </li><li> Parser test
7460 </li><li> Parser_test
7461 </li><li>
7462 </li><li>
7463 </li><li> Talk
7464 </li><li> Talk
7465 </li><li>
7466 </li><li>
7467 </li><li> <a href="/index.php?title=Template:Dynamic&amp;action=edit&amp;redlink=1" class="new" title="Template:Dynamic (page does not exist)">Template:Dynamic</a>
7468 </li></ul>
7469
7470 !! end
7471 ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included.
7472
7473 !! test
7474 Gallery
7475 !! input
7476 <gallery>
7477 image1.png |
7478 image2.gif|||||
7479
7480 image3|
7481 image4 |300px| centre
7482 image5.svg| http://///////
7483 [[x|xx]]]]
7484 * image6
7485 </gallery>
7486 !! result
7487 <ul class="gallery">
7488 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7489 <div style="height: 150px;">Image1.png</div>
7490 <div class="gallerytext">
7491 </div>
7492 </div></li>
7493 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7494 <div style="height: 150px;">Image2.gif</div>
7495 <div class="gallerytext">
7496 <p>||||
7497 </p>
7498 </div>
7499 </div></li>
7500 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7501 <div style="height: 150px;">Image3</div>
7502 <div class="gallerytext">
7503 </div>
7504 </div></li>
7505 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7506 <div style="height: 150px;">Image4</div>
7507 <div class="gallerytext">
7508 <p>300px| centre
7509 </p>
7510 </div>
7511 </div></li>
7512 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7513 <div style="height: 150px;">Image5.svg</div>
7514 <div class="gallerytext">
7515 <p><a rel="nofollow" class="external free" href="http://///////">http://///////</a>
7516 </p>
7517 </div>
7518 </div></li>
7519 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7520 <div style="height: 150px;">* image6</div>
7521 <div class="gallerytext">
7522 </div>
7523 </div></li>
7524 </ul>
7525
7526 !! end
7527
7528 !! test
7529 Gallery (with options)
7530 !! input
7531 <gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' >
7532 File:Nonexistant.jpg|caption
7533 File:Nonexistant.jpg
7534 image:foobar.jpg|some '''caption''' [[Main Page]]
7535 image:foobar.jpg
7536 image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
7537 </gallery>
7538 !! result
7539 <ul class="gallery" style="max-width: 226px;_width: 226px;">
7540 <li class='gallerycaption'>Foo <a href="/wiki/Main_Page" title="Main Page">Main Page</a></li>
7541 <li class="gallerybox" style="width: 105px"><div style="width: 105px">
7542 <div style="height: 70px;">Nonexistant.jpg</div>
7543 <div class="gallerytext">
7544 <p>caption
7545 </p>
7546 </div>
7547 </div></li>
7548 <li class="gallerybox" style="width: 105px"><div style="width: 105px">
7549 <div style="height: 70px;">Nonexistant.jpg</div>
7550 <div class="gallerytext">
7551 </div>
7552 </div></li>
7553 <li class="gallerybox" style="width: 105px"><div style="width: 105px">
7554 <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
7555 <div class="gallerytext">
7556 <p>some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
7557 </p>
7558 </div>
7559 </div></li>
7560 <li class="gallerybox" style="width: 105px"><div style="width: 105px">
7561 <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
7562 <div class="gallerytext">
7563 </div>
7564 </div></li>
7565 <li class="gallerybox" style="width: 105px"><div style="width: 105px">
7566 <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/3/3a/Foobar.jpg" width="70" height="8" /></a></div></div>
7567 <div class="gallerytext">
7568 <p>Blabla|blabla.
7569 </p>
7570 </div>
7571 </div></li>
7572 </ul>
7573
7574 !! end
7575
7576 !! test
7577 Gallery with wikitext inside caption
7578 !! input
7579 <gallery>
7580 File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt
7581 File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt
7582 </gallery>
7583 !! result
7584 <ul class="gallery">
7585 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7586 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7587 <div class="gallerytext">
7588 <p><a href="/wiki/File:Foobar.jpg" class="image" title="desc"><img alt="inneralt" src="http://example.com/images/3/3a/Foobar.jpg" width="20" height="2" /></a>
7589 </p>
7590 </div>
7591 </div></li>
7592 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7593 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7594 <div class="gallerytext">
7595 <p>This is a test template
7596 </p>
7597 </div>
7598 </div></li>
7599 </ul>
7600
7601 !! end
7602
7603 !! test
7604 gallery (with showfilename option)
7605 !! input
7606 <gallery showfilename>
7607 File:Nonexistant.jpg|caption
7608 File:Nonexistant.jpg
7609 image:foobar.jpg|some '''caption''' [[Main Page]]
7610 File:Foobar.jpg
7611 </gallery>
7612 !! result
7613 <ul class="gallery">
7614 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7615 <div style="height: 150px;">Nonexistant.jpg</div>
7616 <div class="gallerytext">
7617 <p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
7618 caption
7619 </p>
7620 </div>
7621 </div></li>
7622 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7623 <div style="height: 150px;">Nonexistant.jpg</div>
7624 <div class="gallerytext">
7625 <p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br />
7626 </p>
7627 </div>
7628 </div></li>
7629 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7630 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7631 <div class="gallerytext">
7632 <p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
7633 some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
7634 </p>
7635 </div>
7636 </div></li>
7637 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7638 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7639 <div class="gallerytext">
7640 <p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br />
7641 </p>
7642 </div>
7643 </div></li>
7644 </ul>
7645
7646 !! end
7647
7648 !! test
7649 Gallery (with namespace-less filenames)
7650 !! input
7651 <gallery>
7652 File:Nonexistant.jpg
7653 Nonexistant.jpg
7654 image:foobar.jpg
7655 foobar.jpg
7656 </gallery>
7657 !! result
7658 <ul class="gallery">
7659 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7660 <div style="height: 150px;">Nonexistant.jpg</div>
7661 <div class="gallerytext">
7662 </div>
7663 </div></li>
7664 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7665 <div style="height: 150px;">Nonexistant.jpg</div>
7666 <div class="gallerytext">
7667 </div>
7668 </div></li>
7669 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7670 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7671 <div class="gallerytext">
7672 </div>
7673 </div></li>
7674 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
7675 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
7676 <div class="gallerytext">
7677 </div>
7678 </div></li>
7679 </ul>
7680
7681 !! end
7682
7683 !! test
7684 HTML Hex character encoding (spells the word "JavaScript")
7685 !! input
7686 &#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
7687 !! result
7688 <p>&#x4a;&#x61;&#x76;&#x61;&#x53;&#x63;&#114;&#x69;&#112;&#x74;
7689 </p>
7690 !! end
7691
7692 !! test
7693 HTML Hex character encoding bogus encoding (bug 26437 regression check)
7694 !! input
7695 &#xsee;&#XSEE;
7696 !! result
7697 <p>&amp;#xsee;&amp;#XSEE;
7698 </p>
7699 !! end
7700
7701 !! test
7702 HTML Hex character encoding mixed case
7703 !! input
7704 &#xEE;&#Xee;
7705 !! result
7706 <p>&#xee;&#xee;
7707 </p>
7708 !! end
7709
7710 !! test
7711 __FORCETOC__ override
7712 !! input
7713 __NEWSECTIONLINK__
7714 __FORCETOC__
7715 !! result
7716 <p><br />
7717 </p>
7718 !! end
7719
7720 !! test
7721 ISBN code coverage
7722 !! input
7723 ISBN 978-0-1234-56&#x20;789
7724 !! result
7725 <p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a>&#x20;789
7726 </p>
7727 !! end
7728
7729 !! test
7730 ISBN followed by 5 spaces
7731 !! input
7732 ISBN
7733 !! result
7734 <p>ISBN
7735 </p>
7736 !! end
7737
7738 !! test
7739 Double ISBN
7740 !! input
7741 ISBN ISBN 1234567890
7742 !! result
7743 <p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
7744 </p>
7745 !! end
7746
7747 !! test
7748 Bug 22905: <abbr> followed by ISBN followed by </a>
7749 !! input
7750 <abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
7751 !! result
7752 <p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
7753 </p>
7754 !! end
7755
7756 !! test
7757 Double RFC
7758 !! input
7759 RFC RFC 1234
7760 !! result
7761 <p>RFC <a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc1234">RFC 1234</a>
7762 </p>
7763 !! end
7764
7765 !! test
7766 Double RFC with a wiki link
7767 !! input
7768 RFC [[RFC 1234]]
7769 !! result
7770 <p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
7771 </p>
7772 !! end
7773
7774 !! test
7775 RFC code coverage
7776 !! input
7777 RFC 983&#x20;987
7778 !! result
7779 <p><a class="external mw-magiclink-rfc" href="//tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
7780 </p>
7781 !! end
7782
7783 !! test
7784 Centre-aligned image
7785 !! input
7786 [[Image:foobar.jpg|centre]]
7787 !! result
7788 <div class="center"><div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div></div>
7789
7790 !!end
7791
7792 !! test
7793 None-aligned image
7794 !! input
7795 [[Image:foobar.jpg|none]]
7796 !! result
7797 <div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
7798
7799 !!end
7800
7801 !! test
7802 Width + Height sized image (using px) (height is ignored)
7803 !! input
7804 [[Image:foobar.jpg|640x480px]]
7805 !! result
7806 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
7807 </p>
7808 !!end
7809
7810 !! test
7811 Width-sized image (using px, no following whitespace)
7812 !! input
7813 [[Image:foobar.jpg|640px]]
7814 !! result
7815 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
7816 </p>
7817 !!end
7818
7819 !! test
7820 Width-sized image (using px, with following whitespace - test regression from r39467)
7821 !! input
7822 [[Image:foobar.jpg|640px ]]
7823 !! result
7824 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
7825 </p>
7826 !!end
7827
7828 !! test
7829 Width-sized image (using px, with preceding whitespace - test regression from r39467)
7830 !! input
7831 [[Image:foobar.jpg| 640px]]
7832 !! result
7833 <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="640" height="73" /></a>
7834 </p>
7835 !!end
7836
7837 !! test
7838 Another italics / bold test
7839 !! input
7840 ''' ''x'
7841 !! result
7842 <pre>'<i> </i>x'
7843 </pre>
7844 !!end
7845
7846 # Note the results may be incorrect, as parserTest output included this:
7847 # XML error: Mismatched tag at byte 6120:
7848 # ...<dd> </dt></dl> </dd...
7849 !! test
7850 dt/dd/dl test
7851 !! options
7852 disabled
7853 !! input
7854 :;;;::
7855 !! result
7856 <dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd>
7857 </dd></dl>
7858 </dd></dl>
7859 </dt></dl>
7860 </dt></dl>
7861 </dt></dl>
7862 </dd></dl>
7863
7864 !!end
7865
7866
7867 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
7868 !! test
7869 Images with the "|" character in the comment
7870 !! input
7871 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
7872 !! result
7873 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
7874
7875 !!end
7876
7877 !! test
7878 [Before] HTML without raw HTML enabled ($wgRawHtml==false)
7879 !! input
7880 <html><script>alert(1);</script></html>
7881 !! result
7882 <p>&lt;html&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/html&gt;
7883 </p>
7884 !! end
7885
7886 !! test
7887 HTML with raw HTML ($wgRawHtml==true)
7888 !! options
7889 rawhtml
7890 !! input
7891 <html><script>alert(1);</script></html>
7892 !! result
7893 <p><script>alert(1);</script>
7894 </p>
7895 !! end
7896
7897 !! test
7898 Parents of subpages, one level up
7899 !! options
7900 subpage title=[[Subpage test/L1/L2/L3]]
7901 !! input
7902 [[../|L2]]
7903 !! result
7904 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
7905 </p>
7906 !! end
7907
7908
7909 !! test
7910 Parents of subpages, one level up, not named
7911 !! options
7912 subpage title=[[Subpage test/L1/L2/L3]]
7913 !! input
7914 [[../]]
7915 !! result
7916 <p><a href="/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
7917 </p>
7918 !! end
7919
7920
7921
7922 !! test
7923 Parents of subpages, two levels up
7924 !! options
7925 subpage title=[[Subpage test/L1/L2/L3]]
7926 !! input
7927 [[../../|L1]]2
7928
7929 [[../../|L1]]l
7930 !! result
7931 <p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
7932 </p><p><a href="/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
7933 </p>
7934 !! end
7935
7936 !! test
7937 Parents of subpages, two levels up, without trailing slash or name.
7938 !! options
7939 subpage title=[[Subpage test/L1/L2/L3]]
7940 !! input
7941 [[../..]]
7942 !! result
7943 <p>[[../..]]
7944 </p>
7945 !! end
7946
7947 !! test
7948 Parents of subpages, two levels up, with lots of extra trailing slashes.
7949 !! options
7950 subpage title=[[Subpage test/L1/L2/L3]]
7951 !! input
7952 [[../../////]]
7953 !! result
7954 <p><a href="/index.php?title=Subpage_test/L1////&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a>
7955 </p>
7956 !! end
7957
7958 !! test
7959 Definition list code coverage
7960 !! input
7961 ; title : def
7962 ; title : def
7963 ;title: def
7964 !! result
7965 <dl><dt> title &#160;</dt><dd> def
7966 </dd><dt> title&#160;</dt><dd> def
7967 </dd><dt>title</dt><dd> def
7968 </dd></dl>
7969
7970 !! end
7971
7972 !! test
7973 Don't fall for the self-closing div
7974 !! input
7975 <div>hello world</div/>
7976 !! result
7977 <div>hello world</div>
7978
7979 !! end
7980
7981 !! test
7982 MSGNW magic word
7983 !! input
7984 {{MSGNW:msg}}
7985 !! result
7986 <p>&#91;&#91;:Template:Msg&#93;&#93;
7987 </p>
7988 !! end
7989
7990 !! test
7991 RAW magic word
7992 !! input
7993 {{RAW:QUERTY}}
7994 !! result
7995 <p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
7996 </p>
7997 !! end
7998
7999 # This isn't needed for XHTML conformance, but would be handy as a fallback security measure
8000 !! test
8001 Always escape literal '>' in output, not just after '<'
8002 !! input
8003 ><>
8004 !! result
8005 <p>&gt;&lt;&gt;
8006 </p>
8007 !! end
8008
8009 !! test
8010 Template caching
8011 !! input
8012 {{Test}}
8013 {{Test}}
8014 !! result
8015 <p>This is a test template
8016 This is a test template
8017 </p>
8018 !! end
8019
8020
8021 !! article
8022 MediaWiki:Fake
8023 !! text
8024 ==header==
8025 !! endarticle
8026
8027 !! test
8028 Inclusion of !userCanEdit() content
8029 !! input
8030 {{MediaWiki:Fake}}
8031 !! result
8032 <h2><span class="editsection">[<a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a>]</span> <span class="mw-headline" id="header">header</span></h2>
8033
8034 !! end
8035
8036
8037 !! test
8038 Out-of-order TOC heading levels
8039 !! input
8040 ==2==
8041 ======6======
8042 ===3===
8043 =1=
8044 =====5=====
8045 ==2==
8046 !! result
8047 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
8048 <ul>
8049 <li class="toclevel-1 tocsection-1"><a href="#2"><span class="tocnumber">1</span> <span class="toctext">2</span></a>
8050 <ul>
8051 <li class="toclevel-2 tocsection-2"><a href="#6"><span class="tocnumber">1.1</span> <span class="toctext">6</span></a></li>
8052 <li class="toclevel-2 tocsection-3"><a href="#3"><span class="tocnumber">1.2</span> <span class="toctext">3</span></a></li>
8053 </ul>
8054 </li>
8055 <li class="toclevel-1 tocsection-4"><a href="#1"><span class="tocnumber">2</span> <span class="toctext">1</span></a>
8056 <ul>
8057 <li class="toclevel-2 tocsection-5"><a href="#5"><span class="tocnumber">2.1</span> <span class="toctext">5</span></a></li>
8058 <li class="toclevel-2 tocsection-6"><a href="#2_2"><span class="tocnumber">2.2</span> <span class="toctext">2</span></a></li>
8059 </ul>
8060 </li>
8061 </ul>
8062 </td></tr></table>
8063 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2">2</span></h2>
8064 <h6><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: 6">edit</a>]</span> <span class="mw-headline" id="6">6</span></h6>
8065 <h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 3">edit</a>]</span> <span class="mw-headline" id="3">3</span></h3>
8066 <h1><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: 1">edit</a>]</span> <span class="mw-headline" id="1">1</span></h1>
8067 <h5><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: 5">edit</a>]</span> <span class="mw-headline" id="5">5</span></h5>
8068 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2_2">2</span></h2>
8069
8070 !! end
8071
8072
8073 !! test
8074 ISBN with a dummy number
8075 !! input
8076 ISBN ---
8077 !! result
8078 <p>ISBN ---
8079 </p>
8080 !! end
8081
8082
8083 !! test
8084 ISBN with space-delimited number
8085 !! input
8086 ISBN 92 9017 032 8
8087 !! result
8088 <p><a href="/wiki/Special:BookSources/9290170328" class="internal mw-magiclink-isbn">ISBN 92 9017 032 8</a>
8089 </p>
8090 !! end
8091
8092
8093 !! test
8094 ISBN with multiple spaces, no number
8095 !! input
8096 ISBN foo
8097 !! result
8098 <p>ISBN foo
8099 </p>
8100 !! end
8101
8102
8103 !! test
8104 ISBN length
8105 !! input
8106 ISBN 123456789
8107
8108 ISBN 1234567890
8109
8110 ISBN 12345678901
8111 !! result
8112 <p>ISBN 123456789
8113 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>
8114 </p><p>ISBN 12345678901
8115 </p>
8116 !! end
8117
8118
8119 !! test
8120 ISBN with trailing year (bug 8110)
8121 !! input
8122 ISBN 1-234-56789-0 - 2006
8123
8124 ISBN 1 234 56789 0 - 2006
8125 !! result
8126 <p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1-234-56789-0</a> - 2006
8127 </p><p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1 234 56789 0</a> - 2006
8128 </p>
8129 !! end
8130
8131
8132 !! test
8133 anchorencode
8134 !! input
8135 {{anchorencode:foo bar©#%n}}
8136 !! result
8137 <p>foo_bar.C2.A9.23.25n
8138 </p>
8139 !! end
8140
8141 !! test
8142 anchorencode trims spaces
8143 !! input
8144 {{anchorencode: __pretty__please__}}
8145 !! result
8146 <p>pretty_please
8147 </p>
8148 !! end
8149
8150 !! test
8151 anchorencode deals with links
8152 !! input
8153 {{anchorencode: [[hello|world]] [[hi]]}}
8154 !! result
8155 <p>world_hi
8156 </p>
8157 !! end
8158
8159 !! test
8160 anchorencode deals with templates
8161 !! input
8162 {{anchorencode: {{Foo}} }}
8163 !! result
8164 <p>FOO
8165 </p>
8166 !! end
8167
8168 !! test
8169 anchorencode encodes like the TOC generator: (bug 18431)
8170 !! input
8171 === _ +:.3A%3A&&amp;]] ===
8172 {{anchorencode: _ +:.3A%3A&&amp;]] }}
8173 __NOEDITSECTION__
8174 !! result
8175 <h3> <span class="mw-headline" id=".2B:.3A.253A.26.26.5D.5D"> _ +:.3A%3A&amp;&amp;]] </span></h3>
8176 <p>.2B:.3A.253A.26.26.5D.5D
8177 </p>
8178 !! end
8179
8180 # Expected output in the following test is not necessarily expected (there
8181 # should probably be <p> tags inside the <blockquote> in the output) -- it's
8182 # only testing for well-formedness.
8183 !! test
8184 Bug 6200: blockquotes and paragraph formatting
8185 !! input
8186 <blockquote>
8187 foo
8188 </blockquote>
8189
8190 bar
8191
8192 baz
8193 !! result
8194 <blockquote>
8195 foo
8196 </blockquote>
8197 <p>bar
8198 </p>
8199 <pre>baz
8200 </pre>
8201 !! end
8202
8203 !! test
8204 Bug 8293: Use of center tag ruins paragraph formatting
8205 !! input
8206 <center>
8207 foo
8208 </center>
8209
8210 bar
8211
8212 baz
8213 !! result
8214 <center>
8215 <p>foo
8216 </p>
8217 </center>
8218 <p>bar
8219 </p>
8220 <pre>baz
8221 </pre>
8222 !! end
8223
8224
8225 ###
8226 ### Language variants related tests
8227 ###
8228 !! test
8229 Self-link in language variants
8230 !! options
8231 title=[[Dunav]] language=sr
8232 !! input
8233 Both [[Dunav]] and [[Дунав]] are names for this river.
8234 !! result
8235 <p>Both <strong class="selflink">Dunav</strong> and <strong class="selflink">Дунав</strong> are names for this river.
8236 </p>
8237 !!end
8238
8239
8240 !! test
8241 Link to pages in language variants
8242 !! options
8243 language=sr
8244 !! input
8245 Main Page can be written as [[Маин Паге]]
8246 !! result
8247 <p>Main Page can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>
8248 </p>
8249 !!end
8250
8251
8252 !! test
8253 Multiple links to pages in language variants
8254 !! options
8255 language=sr
8256 !! input
8257 [[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]].
8258 !! result
8259 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> can be written as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a> same as <a href="/wiki/Main_Page" title="Main Page">Маин Паге</a>.
8260 </p>
8261 !!end
8262
8263
8264 !! test
8265 Simple template in language variants
8266 !! options
8267 language=sr
8268 !! input
8269 {{тест}}
8270 !! result
8271 <p>This is a test template
8272 </p>
8273 !! end
8274
8275
8276 !! test
8277 Template with explicit namespace in language variants
8278 !! options
8279 language=sr
8280 !! input
8281 {{Template:тест}}
8282 !! result
8283 <p>This is a test template
8284 </p>
8285 !! end
8286
8287
8288 !! test
8289 Basic test for template parameter in language variants
8290 !! options
8291 language=sr
8292 !! input
8293 {{парамтест|param=foo}}
8294 !! result
8295 <p>This is a test template with parameter foo
8296 </p>
8297 !! end
8298
8299
8300 !! test
8301 Simple category in language variants
8302 !! options
8303 language=sr cat
8304 !! input
8305 [[Category:МедиаWики Усер'с Гуиде]]
8306 !! result
8307 <a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%98%D0%B0:MediaWiki_User%27s_Guide" title="Категорија:MediaWiki User's Guide">MediaWiki User's Guide</a>
8308 !! end
8309
8310
8311 !! test
8312 Stripping -{}- tags (language variants)
8313 !! options
8314 language=sr
8315 !! input
8316 Latin proverb: -{Ne nuntium necare}-
8317 !! result
8318 <p>Latin proverb: Ne nuntium necare
8319 </p>
8320 !! end
8321
8322
8323 !! test
8324 Prevent conversion with -{}- tags (language variants)
8325 !! options
8326 language=sr variant=sr-ec
8327 !! input
8328 Latinski: -{Ne nuntium necare}-
8329 !! result
8330 <p>Латински: Ne nuntium necare
8331 </p>
8332 !! end
8333
8334
8335 !! test
8336 Prevent conversion of text with -{}- tags (language variants)
8337 !! options
8338 language=sr variant=sr-ec
8339 !! input
8340 Latinski: -{Ne nuntium necare}-
8341 !! result
8342 <p>Латински: Ne nuntium necare
8343 </p>
8344 !! end
8345
8346
8347 !! test
8348 Prevent conversion of links with -{}- tags (language variants)
8349 !! options
8350 language=sr variant=sr-ec
8351 !! input
8352 -{[[Main Page]]}-
8353 !! result
8354 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
8355 </p>
8356 !! end
8357
8358
8359 !! test
8360 -{}- tags within headlines (within html for parserConvert())
8361 !! options
8362 language=sr variant=sr-ec
8363 !! input
8364 == -{Naslov}- ==
8365 !! result
8366 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
8367
8368 !! end
8369
8370
8371 !! test
8372 Explicit definition of language variant alternatives
8373 !! options
8374 language=zh variant=zh-tw
8375 !! input
8376 -{zh:China;zh-tw:Taiwan}-, not China
8377 !! result
8378 <p>Taiwan, not China
8379 </p>
8380 !! end
8381
8382
8383 !! test
8384 Explicit session-wise language variant mapping (A flag and - flag)
8385 !! options
8386 language=zh variant=zh-tw
8387 !! input
8388 Taiwan is not China.
8389 But -{A|zh:China;zh-tw:Taiwan}- is China,
8390 (This-{-|zh:China;zh-tw:Taiwan}- should be stripped!)
8391 and -{China}- is China.
8392 !! result
8393 <p>Taiwan is not China.
8394 But Taiwan is Taiwan,
8395 (This should be stripped!)
8396 and China is China.
8397 </p>
8398 !! end
8399
8400 !! test
8401 Explicit session-wise language variant mapping (H flag for hide)
8402 !! options
8403 language=zh variant=zh-tw
8404 !! input
8405 (This-{H|zh:China;zh-tw:Taiwan}- should be stripped!)
8406 Taiwan is China.
8407 !! result
8408 <p>(This should be stripped!)
8409 Taiwan is Taiwan.
8410 </p>
8411 !! end
8412
8413 !! test
8414 Adding explicit conversion rule for title (T flag)
8415 !! options
8416 language=zh variant=zh-tw showtitle
8417 !! input
8418 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
8419 !! result
8420 Taiwan
8421 <p>Should be stripped!
8422 </p>
8423 !! end
8424
8425 !! test
8426 Testing that changing the language variant here in the tests actually works
8427 !! options
8428 language=zh variant=zh showtitle
8429 !! input
8430 Should be stripped-{T|zh:China;zh-tw:Taiwan}-!
8431 !! result
8432 China
8433 <p>Should be stripped!
8434 </p>
8435 !! end
8436
8437 !! test
8438 Bug 24072: more test on conversion rule for title
8439 !! options
8440 language=zh variant=zh-tw showtitle
8441 !! input
8442 This should be stripped-{T|zh:China;zh-tw:Taiwan}-!
8443 This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-.
8444 !! result
8445 Taiwan
8446 <p>This should be stripped!
8447 This won't take interferes with the title rule.
8448 </p>
8449 !! end
8450
8451 !! test
8452 Raw output of variant escape tags (R flag)
8453 !! options
8454 language=zh variant=zh-tw
8455 !! input
8456 Raw: -{R|zh:China;zh-tw:Taiwan}-
8457 !! result
8458 <p>Raw: zh:China;zh-tw:Taiwan
8459 </p>
8460 !! end
8461
8462 !! test
8463 Nested using of manual convert syntax
8464 !! options
8465 language=zh variant=zh-hk
8466 !! input
8467 Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-!
8468 !! result
8469 <p>Nested: Hello Hong Kong!
8470 </p>
8471 !! end
8472
8473 !! test
8474 Do not convert roman numbers to language variants
8475 !! options
8476 language=sr variant=sr-ec
8477 !! input
8478 Fridrih IV je car.
8479 !! result
8480 <p>Фридрих IV је цар.
8481 </p>
8482 !! end
8483
8484 !! test
8485 Unclosed language converter markup "-{"
8486 !! options
8487 language=sr
8488 !! input
8489 -{T|hello
8490 !! result
8491 <p>-{T|hello
8492 </p>
8493 !! end
8494
8495 !! test
8496 Don't convert raw rule "-{R|=&gt;}-" to "=>"
8497 !! options
8498 language=sr
8499 !! input
8500 -{R|=&gt;}-
8501 !! result
8502 <p>=&gt;
8503 </p>
8504 !!end
8505
8506 !!article
8507 Template:Bullet
8508 !!text
8509 * Bar
8510 !!endarticle
8511
8512 !! test
8513 Bug 529: Uncovered bullet
8514 !! input
8515 * Foo {{bullet}}
8516 !! result
8517 <ul><li> Foo
8518 </li><li> Bar
8519 </li></ul>
8520
8521 !! end
8522
8523 !! test
8524 Bug 529: Uncovered table already at line-start
8525 !! input
8526 x
8527
8528 {{table}}
8529 y
8530 !! result
8531 <p>x
8532 </p>
8533 <table>
8534 <tr>
8535 <td> 1 </td>
8536 <td> 2
8537 </td></tr>
8538 <tr>
8539 <td> 3 </td>
8540 <td> 4
8541 </td></tr></table>
8542 <p>y
8543 </p>
8544 !! end
8545
8546 !! test
8547 Bug 529: Uncovered bullet in parser function result
8548 !! input
8549 * Foo {{lc:{{bullet}} }}
8550 !! result
8551 <ul><li> Foo
8552 </li><li> bar
8553 </li></ul>
8554
8555 !! end
8556
8557 !! test
8558 Bug 5678: Double-parsed template argument
8559 !! input
8560 {{lc:{{{1}}}|hello}}
8561 !! result
8562 <p>{{{1}}}
8563 </p>
8564 !! end
8565
8566 !! test
8567 Bug 5678: Double-parsed template invocation
8568 !! input
8569 {{lc:{{paramtest {{!}} param = hello }} }}
8570 !! result
8571 <p>{{paramtest | param = hello }}
8572 </p>
8573 !! end
8574
8575 !! test
8576 Case insensitivity of parser functions for non-ASCII characters (bug 8143)
8577 !! options
8578 language=cs
8579 title=[[Main Page]]
8580 !! input
8581 {{PRVNÍVELKÉ:ěščř}}
8582 {{prvnívelké:ěščř}}
8583 {{PRVNÍMALÉ:ěščř}}
8584 {{prvnímalé:ěščř}}
8585 {{MALÁ:ěščř}}
8586 {{malá:ěščř}}
8587 {{VELKÁ:ěščř}}
8588 {{velká:ěščř}}
8589 !! result
8590 <p>Ěščř
8591 Ěščř
8592 ěščř
8593 ěščř
8594 ěščř
8595 ěščř
8596 ĚŠČŘ
8597 ĚŠČŘ
8598 </p>
8599 !! end
8600
8601 !! test
8602 Morwen/13: Unclosed link followed by heading
8603 !! input
8604 [[link
8605 ==heading==
8606 !! result
8607 <p>[[link
8608 </p>
8609 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
8610
8611 !! end
8612
8613 !! test
8614 HHP2.1: Heuristics for headings in preprocessor parenthetical structures
8615 !! input
8616 {{foo|
8617 =heading=
8618 !! result
8619 <p>{{foo|
8620 </p>
8621 <h1> <span class="mw-headline" id="heading">heading</span></h1>
8622
8623 !! end
8624
8625 !! test
8626 HHP2.2: Heuristics for headings in preprocessor parenthetical structures
8627 !! input
8628 {{foo|
8629 ==heading==
8630 !! result
8631 <p>{{foo|
8632 </p>
8633 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
8634
8635 !! end
8636
8637 !! test
8638 Tildes in comments
8639 !! options
8640 pst
8641 !! input
8642 <!-- ~~~~ -->
8643 !! result
8644 <!-- ~~~~ -->
8645 !! end
8646
8647 !! test
8648 Paragraphs inside divs (no extra line breaks)
8649 !! input
8650 <div>Line one
8651
8652 Line two</div>
8653 !! result
8654 <div>Line one
8655 Line two</div>
8656
8657 !! end
8658
8659 !! test
8660 Paragraphs inside divs (extra line break on open)
8661 !! input
8662 <div>
8663 Line one
8664
8665 Line two</div>
8666 !! result
8667 <div>
8668 <p>Line one
8669 </p>
8670 Line two</div>
8671
8672 !! end
8673
8674 !! test
8675 Paragraphs inside divs (extra line break on close)
8676 !! input
8677 <div>Line one
8678
8679 Line two
8680 </div>
8681 !! result
8682 <div>Line one
8683 <p>Line two
8684 </p>
8685 </div>
8686
8687 !! end
8688
8689 !! test
8690 Paragraphs inside divs (extra line break on open and close)
8691 !! input
8692 <div>
8693 Line one
8694
8695 Line two
8696 </div>
8697 !! result
8698 <div>
8699 <p>Line one
8700 </p><p>Line two
8701 </p>
8702 </div>
8703
8704 !! end
8705
8706 !! test
8707 Nesting tags, paragraphs on lines which begin with <div>
8708 !! options
8709 disabled
8710 !! input
8711 <div></div><strong>A
8712 B</strong>
8713 !! result
8714 <div></div>
8715 <p><strong>A
8716 B</strong>
8717 </p>
8718 !! end
8719
8720 # Bug 6200: <blockquote> should behave like <div> with respect to line breaks
8721 !! test
8722 Bug 6200: paragraphs inside blockquotes (no extra line breaks)
8723 !! options
8724 disabled
8725 !! input
8726 <blockquote>Line one
8727
8728 Line two</blockquote>
8729 !! result
8730 <blockquote>Line one
8731 Line two</blockquote>
8732
8733 !! end
8734
8735 !! test
8736 Bug 6200: paragraphs inside blockquotes (extra line break on open)
8737 !! options
8738 disabled
8739 !! input
8740 <blockquote>
8741 Line one
8742
8743 Line two</blockquote>
8744 !! result
8745 <blockquote>
8746 <p>Line one
8747 </p>
8748 Line two</blockquote>
8749
8750 !! end
8751
8752 !! test
8753 Bug 6200: paragraphs inside blockquotes (extra line break on close)
8754 !! options
8755 disabled
8756 !! input
8757 <blockquote>Line one
8758
8759 Line two
8760 </blockquote>
8761 !! result
8762 <blockquote>Line one
8763 <p>Line two
8764 </p>
8765 </blockquote>
8766
8767 !! end
8768
8769 !! test
8770 Bug 6200: paragraphs inside blockquotes (extra line break on open and close)
8771 !! options
8772 disabled
8773 !! input
8774 <blockquote>
8775 Line one
8776
8777 Line two
8778 </blockquote>
8779 !! result
8780 <blockquote>
8781 <p>Line one
8782 </p><p>Line two
8783 </p>
8784 </blockquote>
8785
8786 !! end
8787
8788 !! test
8789 Paragraphs inside blockquotes/divs (no extra line breaks)
8790 !! input
8791 <blockquote><div>Line one
8792
8793 Line two</div></blockquote>
8794 !! result
8795 <blockquote><div>Line one
8796 Line two</div></blockquote>
8797
8798 !! end
8799
8800 !! test
8801 Paragraphs inside blockquotes/divs (extra line break on open)
8802 !! input
8803 <blockquote><div>
8804 Line one
8805
8806 Line two</div></blockquote>
8807 !! result
8808 <blockquote><div>
8809 <p>Line one
8810 </p>
8811 Line two</div></blockquote>
8812
8813 !! end
8814
8815 !! test
8816 Paragraphs inside blockquotes/divs (extra line break on close)
8817 !! input
8818 <blockquote><div>Line one
8819
8820 Line two
8821 </div></blockquote>
8822 !! result
8823 <blockquote><div>Line one
8824 <p>Line two
8825 </p>
8826 </div></blockquote>
8827
8828 !! end
8829
8830 !! test
8831 Paragraphs inside blockquotes/divs (extra line break on open and close)
8832 !! input
8833 <blockquote><div>
8834 Line one
8835
8836 Line two
8837 </div></blockquote>
8838 !! result
8839 <blockquote><div>
8840 <p>Line one
8841 </p><p>Line two
8842 </p>
8843 </div></blockquote>
8844
8845 !! end
8846
8847 !! test
8848 Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion
8849 !! options
8850 wgLinkHolderBatchSize=0
8851 !! input
8852 [[meatball:1]]
8853 [[meatball:2]]
8854 [[meatball:3]]
8855 !! result
8856 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?1" class="extiw" title="meatball:1">meatball:1</a>
8857 <a href="http://www.usemod.com/cgi-bin/mb.pl?2" class="extiw" title="meatball:2">meatball:2</a>
8858 <a href="http://www.usemod.com/cgi-bin/mb.pl?3" class="extiw" title="meatball:3">meatball:3</a>
8859 </p>
8860 !! end
8861
8862 !! test
8863 Free external link invading image caption
8864 !! input
8865 [[Image:Foobar.jpg|thumb|http://x|hello]]
8866 !! result
8867 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>hello</div></div></div>
8868
8869 !! end
8870
8871 !! test
8872 Bug 15196: localised external link numbers
8873 !! options
8874 language=fa
8875 !! input
8876 [http://en.wikipedia.org/]
8877 !! result
8878 <p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
8879 </p>
8880 !! end
8881
8882 !! test
8883 Multibyte character in padleft
8884 !! input
8885 {{padleft:-Hello|7|Æ}}
8886 !! result
8887 <p>Æ-Hello
8888 </p>
8889 !! end
8890
8891 !! test
8892 Multibyte character in padright
8893 !! input
8894 {{padright:Hello-|7|Æ}}
8895 !! result
8896 <p>Hello-Æ
8897 </p>
8898 !! end
8899
8900 !! test
8901 Formatted date
8902 !! config
8903 wgUseDynamicDates=1
8904 !! input
8905 [[2009-03-24]]
8906 !! result
8907 <p><span class="mw-formatted-date" title="2009-03-24"><a href="/index.php?title=2009&amp;action=edit&amp;redlink=1" class="new" title="2009 (page does not exist)">2009</a>-<a href="/index.php?title=March_24&amp;action=edit&amp;redlink=1" class="new" title="March 24 (page does not exist)">03-24</a></span>
8908 </p>
8909 !!end
8910
8911 !!test
8912 formatdate parser function
8913 !!input
8914 {{#formatdate:2009-03-24}}
8915 !! result
8916 <p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
8917 </p>
8918 !! end
8919
8920 !!test
8921 formatdate parser function, with default format
8922 !!input
8923 {{#formatdate:2009-03-24|mdy}}
8924 !! result
8925 <p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
8926 </p>
8927 !! end
8928
8929 !! test
8930 Linked date with autoformatting disabled
8931 !! config
8932 wgUseDynamicDates=false
8933 !! input
8934 [[2009-03-24]]
8935 !! result
8936 <p><a href="/index.php?title=2009-03-24&amp;action=edit&amp;redlink=1" class="new" title="2009-03-24 (page does not exist)">2009-03-24</a>
8937 </p>
8938 !! end
8939
8940 !! test
8941 Spacing of numbers in formatted dates
8942 !! input
8943 {{#formatdate:January 15}}
8944 !! result
8945 <p><span class="mw-formatted-date" title="01-15">January 15</span>
8946 </p>
8947 !! end
8948
8949 !! test
8950 Spacing of numbers in formatted dates (linked)
8951 !! config
8952 wgUseDynamicDates=true
8953 !! input
8954 [[January 15]]
8955 !! result
8956 <p><span class="mw-formatted-date" title="01-15"><a href="/index.php?title=January_15&amp;action=edit&amp;redlink=1" class="new" title="January 15 (page does not exist)">January 15</a></span>
8957 </p>
8958 !! end
8959
8960 #
8961 #
8962 #
8963
8964 #
8965 # Edit comments
8966 #
8967
8968 !! test
8969 Edit comment with link
8970 !! options
8971 comment
8972 !! input
8973 I like the [[Main Page]] a lot
8974 !! result
8975 I like the <a href="/wiki/Main_Page" title="Main Page">Main Page</a> a lot
8976 !!end
8977
8978 !! test
8979 Edit comment with link and link text
8980 !! options
8981 comment
8982 !! input
8983 I like the [[Main Page|best pages]] a lot
8984 !! result
8985 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
8986 !!end
8987
8988 !! test
8989 Edit comment with link and link text with suffix
8990 !! options
8991 comment
8992 !! input
8993 I like the [[Main Page|best page]]s a lot
8994 !! result
8995 I like the <a href="/wiki/Main_Page" title="Main Page">best pages</a> a lot
8996 !!end
8997
8998 !! test
8999 Edit comment with section link (non-local, eg in history list)
9000 !! options
9001 comment title=[[Main Page]]
9002 !! input
9003 /* External links */ removed bogus entries
9004 !! result
9005 <a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
9006 !!end
9007
9008 !! test
9009 Edit comment with section link and text before it (non-local, eg in history list)
9010 !! options
9011 comment title=[[Main Page]]
9012 !! input
9013 pre-comment text /* External links */ removed bogus entries
9014 !! result
9015 pre-comment text - <a href="/wiki/Main_Page#External_links" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
9016 !!end
9017
9018 !! test
9019 Edit comment with section link (local, eg in diff view)
9020 !! options
9021 comment local title=[[Main Page]]
9022 !! input
9023 /* External links */ removed bogus entries
9024 !! result
9025 <a href="#External_links">→</a>‎<span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
9026 !!end
9027
9028 !! test
9029 Edit comment with subpage link (bug 14080)
9030 !! options
9031 comment
9032 subpage
9033 title=[[Subpage test]]
9034 !! input
9035 Poked at a [[/subpage]] here...
9036 !! result
9037 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a> here...
9038 !!end
9039
9040 !! test
9041 Edit comment with subpage link and link text (bug 14080)
9042 !! options
9043 comment
9044 subpage
9045 title=[[Subpage test]]
9046 !! input
9047 Poked at a [[/subpage|neat little page]] here...
9048 !! result
9049 Poked at a <a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">neat little page</a> here...
9050 !!end
9051
9052 !! test
9053 Edit comment with bogus subpage link in non-subpage NS (bug 14080)
9054 !! options
9055 comment
9056 title=[[Subpage test]]
9057 !! input
9058 Poked at a [[/subpage]] here...
9059 !! result
9060 Poked at a <a href="/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
9061 !!end
9062
9063 !! test
9064 Edit comment with bare anchor link (local, as on diff)
9065 !! options
9066 comment
9067 local
9068 title=[[Main Page]]
9069 !!input
9070 [[#section]]
9071 !! result
9072 <a href="#section">#section</a>
9073 !! end
9074
9075 !! test
9076 Edit comment with bare anchor link (non-local, as on history)
9077 !! options
9078 comment
9079 title=[[Main Page]]
9080 !!input
9081 [[#section]]
9082 !! result
9083 <a href="/wiki/Main_Page#section" title="Main Page">#section</a>
9084 !! end
9085
9086 !! test
9087 Anchor starting with underscore
9088 !!input
9089 [[#_ref|One]]
9090 !! result
9091 <p><a href="#_ref">One</a>
9092 </p>
9093 !! end
9094
9095 !! test
9096 Id starting with underscore
9097 !!input
9098 <div id="_ref"></div>
9099 !! result
9100 <div id="_ref"></div>
9101
9102 !! end
9103
9104 !! test
9105 Space normalisation on autocomment (bug 22784)
9106 !! options
9107 comment
9108 title=[[Main Page]]
9109 !!input
9110 /* __hello__world__ */
9111 !! result
9112 <a href="/wiki/Main_Page#hello_world" title="Main Page">→</a>‎<span dir="auto"><span class="autocomment">__hello__world__</span></span>
9113 !! end
9114
9115 !! test
9116 percent-encoding and + signs in comments (Bug 26410)
9117 !! options
9118 comment
9119 !!input
9120 [[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
9121 !! result
9122 <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
9123 !! end
9124
9125 !! test
9126 Bad images - basic functionality
9127 !! options
9128 disabled
9129 !! input
9130 [[File:Bad.jpg]]
9131 !! result
9132 !! end
9133
9134 !! test
9135 Bad images - bug 16039: text after bad image disappears
9136 !! options
9137 disabled
9138 !! input
9139 Foo bar
9140 [[File:Bad.jpg]]
9141 Bar foo
9142 !! result
9143 <p>Foo bar
9144 </p><p>Bar foo
9145 </p>
9146 !! end
9147
9148 !! test
9149 Verify that displaytitle works (bug #22501) no displaytitle
9150 !! options
9151 showtitle
9152 !! config
9153 wgAllowDisplayTitle=true
9154 wgRestrictDisplayTitle=false
9155 !! input
9156 this is not the the title
9157 !! result
9158 Parser test
9159 <p>this is not the the title
9160 </p>
9161 !! end
9162
9163 !! test
9164 Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false
9165 !! options
9166 showtitle
9167 title=[[Screen]]
9168 !! config
9169 wgAllowDisplayTitle=true
9170 wgRestrictDisplayTitle=false
9171 !! input
9172 this is not the the title
9173 {{DISPLAYTITLE:whatever}}
9174 !! result
9175 whatever
9176 <p>this is not the the title
9177 </p>
9178 !! end
9179
9180 !! test
9181 Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch
9182 !! options
9183 showtitle
9184 title=[[Screen]]
9185 !! config
9186 wgAllowDisplayTitle=true
9187 wgRestrictDisplayTitle=true
9188 !! input
9189 this is not the the title
9190 {{DISPLAYTITLE:whatever}}
9191 !! result
9192 Screen
9193 <p>this is not the the title
9194 </p>
9195 !! end
9196
9197 !! test
9198 Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching
9199 !! options
9200 showtitle
9201 title=[[Screen]]
9202 !! config
9203 wgAllowDisplayTitle=true
9204 wgRestrictDisplayTitle=true
9205 !! input
9206 this is not the the title
9207 {{DISPLAYTITLE:screen}}
9208 !! result
9209 screen
9210 <p>this is not the the title
9211 </p>
9212 !! end
9213
9214 !! test
9215 Verify that displaytitle works (bug #22501) AllowDisplayTitle=false
9216 !! options
9217 showtitle
9218 title=[[Screen]]
9219 !! config
9220 wgAllowDisplayTitle=false
9221 !! input
9222 this is not the the title
9223 {{DISPLAYTITLE:screen}}
9224 !! result
9225 Screen
9226 <p>this is not the the title
9227 <a href="/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
9228 </p>
9229 !! end
9230
9231 !! test
9232 Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE
9233 !! options
9234 showtitle
9235 title=[[Screen]]
9236 !! config
9237 wgAllowDisplayTitle=false
9238 !! input
9239 this is not the the title
9240 !! result
9241 Screen
9242 <p>this is not the the title
9243 </p>
9244 !! end
9245
9246 !! test
9247 preload: check <noinclude> and <includeonly>
9248 !! options
9249 preload
9250 !! input
9251 Hello <noinclude>cruel</noinclude><includeonly>kind</includeonly> world.
9252 !! result
9253 Hello kind world.
9254 !! end
9255
9256 !! test
9257 preload: check <onlyinclude>
9258 !! options
9259 preload
9260 !! input
9261 Goodbye <onlyinclude>Hello world</onlyinclude>
9262 !! result
9263 Hello world
9264 !! end
9265
9266 !! test
9267 preload: can pass tags through if we want to
9268 !! options
9269 preload
9270 !! input
9271 <includeonly><</includeonly>includeonly>Hello world<includeonly><</includeonly>/includeonly>
9272 !! result
9273 <includeonly>Hello world</includeonly>
9274 !! end
9275
9276 !! test
9277 preload: check that it doesn't try to do tricks
9278 !! options
9279 preload
9280 !! input
9281 * <!-- Hello --> ''{{world}}'' {{<includeonly>subst:</includeonly>How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
9282 !! result
9283 * <!-- Hello --> ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}}
9284 !! end
9285
9286 !! test
9287 Play a bit with r67090 and bug 3158
9288 !! options
9289 disabled
9290 !! input
9291 <div style="width:50% !important">&nbsp;</div>
9292 <div style="width:50%&nbsp;!important">&nbsp;</div>
9293 <div style="width:50%&#160;!important">&nbsp;</div>
9294 <div style="border : solid;">&nbsp;</div>
9295 !! result
9296 <div style="width:50% !important">&nbsp;</div>
9297 <div style="width:50% !important">&nbsp;</div>
9298 <div style="width:50% !important">&nbsp;</div>
9299 <div style="border&#160;: solid;">&nbsp;</div>
9300
9301 !! end
9302
9303 !! test
9304 HTML5 data attributes
9305 !! input
9306 <span data-foo="bar">Baz</span>
9307 <p data-abc-def_hij="">Quuz</p>
9308 !! result
9309 <p><span data-foo="bar">Baz</span>
9310 </p>
9311 <p data-abc-def_hij="">Quuz</p>
9312
9313 !! end
9314
9315 !! test
9316 percent-encoding and + signs in internal links (Bug 26410)
9317 !! input
9318 [[User:+%]] [[Page+title%]]
9319 [[%+]] [[%+|%20]] [[%+ ]] [[%+r]]
9320 [[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
9321 [[%33%45]] [[%33%45+]]
9322 !! result
9323 <p><a href="/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
9324 <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
9325 <a href="/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
9326 <a href="/index.php?title=3E&amp;action=edit&amp;redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="/index.php?title=3E%2B&amp;action=edit&amp;redlink=1" class="new" title="3E+ (page does not exist)">3E+</a>
9327 </p>
9328 !! end
9329
9330 !! test
9331 Special characters in embedded file links (bug 27679)
9332 !! input
9333 [[File:Contains & ampersand.jpg]]
9334 [[File:Does not exist.jpg|Title with & ampersand]]
9335 !! result
9336 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
9337 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
9338 </p>
9339 !! end
9340
9341
9342 !! test
9343 Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
9344 !! input
9345 Text&apos;s been normalized?
9346 !! result
9347 <p>Text&#39;s been normalized?
9348 </p>
9349 !! end
9350
9351 !! test
9352 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links
9353 !! input
9354 http://www.example.org/ <-- U+3000 (vim: ^Vu3000)
9355 !! result
9356 <p><a rel="nofollow" class="external free" href="http://www.example.org/">http://www.example.org/</a> &lt;-- U+3000 (vim: ^Vu3000)
9357 </p>
9358 !! end
9359
9360 !! test
9361 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links
9362 !! input
9363 [http://www.example.org/ ideograms]
9364 !! result
9365 <p><a rel="nofollow" class="external text" href="http://www.example.org/">ideograms</a>
9366 </p>
9367 !! end
9368
9369 !! test
9370 Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links
9371 !! input
9372 http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000)
9373 !! result
9374 <p><img src="http://www.example.org/pic.png" alt="pic.png" /> &lt;-- U+3000 (vim: ^Vu3000)
9375 </p>
9376 !! end
9377
9378 !! article
9379 Mediawiki:loop1
9380 !! text
9381 {{Identical|A}}
9382 !! endarticle
9383
9384 !! article
9385 Mediawiki:loop2
9386 !! text
9387 {{Identical|B}}
9388 !! endarticle
9389
9390 !! article
9391 Template:Identical
9392 !! text
9393 {{int:loop1}}
9394 {{int:loop2}}
9395 !! endarticle
9396
9397 !! test
9398 Bug 31098 Template which includes system messages which includes the template
9399 !! input
9400 {{Identical}}
9401 !! result
9402 <p><span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
9403 <span class="error">Template loop detected: <a href="/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
9404 </p>
9405 !! end
9406
9407 !! test
9408 Deprecated presentational attributes are converted to css
9409 !! input
9410 {|
9411 | valign=top align=left width=100 height=25% | Asdf
9412 |}
9413 <ul type="disc"></ul>
9414 !! result
9415 <table>
9416 <tr>
9417 <td style="text-align: left; height: 25%; vertical-align: top; width: 100px;"> Asdf
9418 </td></tr></table>
9419 <ul style="list-style-type: disc;"></ul>
9420
9421 !! end
9422
9423 !! test
9424 Bug31490 Turkish: ucfirst 'blah'
9425 !! options
9426 language=tr
9427 !! input
9428 {{ucfirst:blah}}
9429 !! result
9430 <p>Blah
9431 </p>
9432 !! end
9433
9434 !! test
9435 Bug31490 Turkish: ucfirst 'ix'
9436 !! options
9437 language=tr
9438 !! input
9439 {{ucfirst:ix}}
9440 !! result
9441 <p>İx
9442 </p>
9443 !! end
9444
9445 !! test
9446 Bug31490 Turkish: lcfirst 'BLAH'
9447 !! options
9448 language=tr
9449 !! input
9450 {{lcfirst:BLAH}}
9451 !! result
9452 <p>bLAH
9453 </p>
9454 !! end
9455
9456 !! test
9457 Bug31490 Turkish: ucfırst (with a dotless i)
9458 !! options
9459 language=tr
9460 !! input
9461 {{ucfırst:blah}}
9462 !! result
9463 <p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
9464 </p>
9465 !! end
9466
9467 !! test
9468 Bug31490 ucfırst (with a dotless i) with English language
9469 !! options
9470 language=en
9471 !! input
9472 {{ucfırst:blah}}
9473 !! result
9474 <p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
9475 </p>
9476 !! end
9477
9478 !! test
9479 Bug 26375: TOC with italics
9480 !! options
9481 title=[[Main Page]]
9482 !! input
9483 __TOC__
9484 == ''Lost'' episodes ==
9485 !! result
9486 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9487 <ul>
9488 <li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
9489 </ul>
9490 </td></tr></table>
9491 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Lost episodes">edit</a>]</span> <span class="mw-headline" id="Lost_episodes"> <i>Lost</i> episodes </span></h2>
9492
9493 !! end
9494
9495 !! test
9496 Bug 26375: TOC with bold
9497 !! options
9498 title=[[Main Page]]
9499 !! input
9500 __TOC__
9501 == '''should be bold''' then normal text ==
9502 !! result
9503 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9504 <ul>
9505 <li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
9506 </ul>
9507 </td></tr></table>
9508 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: should be bold then normal text">edit</a>]</span> <span class="mw-headline" id="should_be_bold_then_normal_text"> <b>should be bold</b> then normal text </span></h2>
9509
9510 !! end
9511
9512 !! test
9513 Bug 33845: Headings become cursive in TOC when they contain an image
9514 !! options
9515 title=[[Main Page]]
9516 !! input
9517 __TOC__
9518 == Image [[Image:foobar.jpg]] ==
9519 !! result
9520 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9521 <ul>
9522 <li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
9523 </ul>
9524 </td></tr></table>
9525 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Image">edit</a>]</span> <span class="mw-headline" id="Image"> Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </span></h2>
9526
9527 !! end
9528
9529 !! test
9530 Bug 33845 (2): Headings become bold in TOC when they contain a blockquote
9531 !! options
9532 title=[[Main Page]]
9533 !! input
9534 __TOC__
9535 == <blockquote>Quote</blockquote> ==
9536 !! result
9537 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9538 <ul>
9539 <li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
9540 </ul>
9541 </td></tr></table>
9542 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Quote">edit</a>]</span> <span class="mw-headline" id="Quote"> <blockquote>Quote</blockquote> </span></h2>
9543
9544 !! end
9545
9546 !! test
9547 Unclosed tags in TOC
9548 !! options
9549 title=[[Main Page]]
9550 !! input
9551 __TOC__
9552 == Proof: 2 < 3 ==
9553 <small>Hanc marginis exiguitas non caperet.</small>
9554 QED
9555 !! result
9556 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9557 <ul>
9558 <li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 &lt; 3</span></a></li>
9559 </ul>
9560 </td></tr></table>
9561 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Proof: 2 &lt; 3">edit</a>]</span> <span class="mw-headline" id="Proof:_2_.3C_3"> Proof: 2 &lt; 3 </span></h2>
9562 <p><small>Hanc marginis exiguitas non caperet.</small>
9563 QED
9564 </p>
9565 !! end
9566
9567 !! test
9568 Multiple tags in TOC
9569 !! input
9570 __TOC__
9571 == <i>Foo</i> <b>Bar</b> ==
9572
9573 == <i>Foo</i> <blockquote>Bar</blockquote> ==
9574 !! result
9575 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9576 <ul>
9577 <li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
9578 <li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
9579 </ul>
9580 </td></tr></table>
9581 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar"> <i>Foo</i> <b>Bar</b> </span></h2>
9582 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> <i>Foo</i> <blockquote>Bar</blockquote> </span></h2>
9583
9584 !! end
9585
9586 !! test
9587 Tags with parameters in TOC
9588 !! input
9589 __TOC__
9590 == <sup class="in-h2">Hello</sup> ==
9591
9592 == <sup class="a > b">Evilbye</sup> ==
9593 !! result
9594 <table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
9595 <ul>
9596 <li class="toclevel-1 tocsection-1"><a href="#Hello"><span class="tocnumber">1</span> <span class="toctext"><sup>Hello</sup></span></a></li>
9597 <li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b"&gt;Evilbye</sup></span></a></li>
9598 </ul>
9599 </td></tr></table>
9600 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Hello">edit</a>]</span> <span class="mw-headline" id="Hello"> <sup class="in-h2">Hello</sup> </span></h2>
9601 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: b&quot;>Evilbye">edit</a>]</span> <span class="mw-headline" id="b.22.3EEvilbye"> <sup> b"&gt;Evilbye</sup> </span></h2>
9602
9603 !! end
9604
9605 !! article
9606 MediaWiki:Bug32057
9607 !! text
9608 == {{int:headline_sample}} ==
9609 !! endarticle
9610
9611 !! test
9612 Bug 32057: Title needed when expanding <h> nodes.
9613 !! options
9614 title=[[Main Page]]
9615 !! input
9616 {{int:Bug32057}}
9617 !! result
9618 <h2><span class="editsection">[<a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Headline text">edit</a>]</span> <span class="mw-headline" id="Headline_text"> Headline text </span></h2>
9619
9620 !! end
9621
9622 !! test
9623 Strip marker in urlencode
9624 !! input
9625 {{urlencode:x<nowiki/>y}}
9626 {{urlencode:x<nowiki/>y|wiki}}
9627 {{urlencode:x<nowiki/>y|path}}
9628 !! result
9629 <p>xy
9630 xy
9631 xy
9632 </p>
9633 !! end
9634
9635 !! test
9636 Strip marker in lc
9637 !! input
9638 {{lc:x<nowiki/>y}}
9639 !! result
9640 <p>xy
9641 </p>
9642 !! end
9643
9644 !! test
9645 Strip marker in uc
9646 !! input
9647 {{uc:x<nowiki/>y}}
9648 !! result
9649 <p>XY
9650 </p>
9651 !! end
9652
9653 !! test
9654 Strip marker in formatNum
9655 !! input
9656 {{formatnum:1<nowiki/>2}}
9657 {{formatnum:1<nowiki/>2|R}}
9658 !! result
9659 <p>12
9660 12
9661 </p>
9662 !! end
9663
9664 !! test
9665 Strip marker in grammar
9666 !! options
9667 language=fi
9668 !! input
9669 {{grammar:elative|foo<nowiki/>bar}}
9670 !! result
9671 <p>foobarista
9672 </p>
9673 !! end
9674
9675 !! test
9676 Strip marker in padleft
9677 !! input
9678 {{padleft:|2|x<nowiki/>y}}
9679 !! result
9680 <p>xy
9681 </p>
9682 !! end
9683
9684 !! test
9685 Strip marker in padright
9686 !! input
9687 {{padright:|2|x<nowiki/>y}}
9688 !! result
9689 <p>xy
9690 </p>
9691 !! end
9692
9693 !! test
9694 Strip marker in anchorencode
9695 !! input
9696 {{anchorencode:x<nowiki/>y}}
9697 !! result
9698 <p>xy
9699 </p>
9700 !! end
9701
9702 !! test
9703 nowiki inside link inside heading (bug 18295)
9704 !! input
9705 ==[[foo|x<nowiki>y</nowiki>z]]==
9706 !! result
9707 <h2><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: xyz">edit</a>]</span> <span class="mw-headline" id="xyz"><a href="/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">xyz</a></span></h2>
9708
9709 !! end
9710
9711 !! test
9712 new support for bdi element (bug 31817)
9713 !! input
9714 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
9715 !! result
9716 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
9717
9718 !!end
9719
9720 !! test
9721 Ignore pipe between table row attributes
9722 !! input
9723 {|
9724 | quux
9725 |- id=foo | style='color: red'
9726 | bar
9727 |}
9728 !! result
9729 <table>
9730 <tr>
9731 <td> quux
9732 </td></tr>
9733 <tr id="foo" style="color: red">
9734 <td> bar
9735 </td></tr></table>
9736
9737 !! end
9738
9739 !!test
9740 Gallery override link with WikiLink (bug 34852)
9741 !! input
9742 <gallery>
9743 File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
9744 </gallery>
9745 !! result
9746 <ul class="gallery">
9747 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
9748 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
9749 <div class="gallerytext">
9750 <p>caption
9751 </p>
9752 </div>
9753 </div></li>
9754 </ul>
9755
9756 !! end
9757
9758 !!test
9759 Gallery override link with absolute external link (bug 34852)
9760 !! input
9761 <gallery>
9762 File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
9763 </gallery>
9764 !! result
9765 <ul class="gallery">
9766 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
9767 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
9768 <div class="gallerytext">
9769 <p>caption
9770 </p>
9771 </div>
9772 </div></li>
9773 </ul>
9774
9775 !! end
9776
9777 !!test
9778 Gallery override link with malicious javascript (bug 34852)
9779 !! input
9780 <gallery>
9781 File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
9782 </gallery>
9783 !! result
9784 <ul class="gallery">
9785 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
9786 <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/3/3a/Foobar.jpg" width="120" height="14" /></a></div></div>
9787 <div class="gallerytext">
9788 <p>caption
9789 </p>
9790 </div>
9791 </div></li>
9792 </ul>
9793
9794 !! end
9795
9796 !!test
9797 Language parser function
9798 !! input
9799 {{#language:ar}}
9800 !! result
9801 <p>العربية
9802 </p>
9803 !! end
9804
9805 !!test
9806 Padleft and padright as substr
9807 !! input
9808 {{padleft:|3|abcde}}
9809 {{padright:|3|abcde}}
9810 !! result
9811 <p>abc
9812 abc
9813 </p>
9814 !! end
9815
9816 !! test
9817 Definition Lists: No nesting: Multiple dd's
9818 !! input
9819 ;x
9820 :a
9821 :b
9822 !! result
9823 <dl><dt>x
9824 </dt><dd>a
9825 </dd><dd>b
9826 </dd></dl>
9827
9828 !! end
9829
9830 !! test
9831 Definition Lists: Indentation: Regular
9832 !! input
9833 :i1
9834 ::i2
9835 :::i3
9836 !! result
9837 <dl><dd>i1
9838 <dl><dd>i2
9839 <dl><dd>i3
9840 </dd></dl>
9841 </dd></dl>
9842 </dd></dl>
9843
9844 !! end
9845
9846 !! test
9847 Definition Lists: Indentation: Missing 1st level
9848 !! input
9849 ::i2
9850 :::i3
9851 !! result
9852 <dl><dd><dl><dd>i2
9853 <dl><dd>i3
9854 </dd></dl>
9855 </dd></dl>
9856 </dd></dl>
9857
9858 !! end
9859
9860 !! test
9861 Definition Lists: Indentation: Multi-level indent
9862 !! input
9863 :::i3
9864 !! result
9865 <dl><dd><dl><dd><dl><dd>i3
9866 </dd></dl>
9867 </dd></dl>
9868 </dd></dl>
9869
9870 !! end
9871
9872 ## The PHP parser treats : items (dd) without a corresponding ; item (dt)
9873 ## as an empty dt item. It also ignores all but the last ";" when followed
9874 ## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in
9875 ## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple
9876 ## ";"s.
9877 ##
9878 ## Ex: ";;t2 ::d2" is transformed into:
9879 ##
9880 ## <dl>
9881 ## <dt>t2 </dt>
9882 ## <dd>
9883 ## <dl>
9884 ## <dt></dt>
9885 ## <dd>d2</dd>
9886 ## </dl>
9887 ## </dd>
9888 ## </dl>
9889 ##
9890 ## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text
9891 ## So, the same wikitext above (;;t2 ::d2) is transformed into:
9892 ##
9893 ## <dl>
9894 ## <dt>
9895 ## <dl>
9896 ## <dt>t2 </dt>
9897 ## <dd>:d2</dd>
9898 ## </dl>
9899 ## </dt>
9900 ## </dl>
9901 ##
9902 ## All Parsoid only definition list tests have this difference.
9903
9904 !! test
9905 Definition Lists: Nesting: Multi-level (Parsoid only)
9906 !! options
9907 disabled
9908 !! input
9909 ;t1 :d1
9910 ;;t2 ::d2
9911 ;;;t3 :::d3
9912 !! result
9913 <dl>
9914 <dt>t1 </dt>
9915 <dd>d1</dd>
9916 <dt>
9917 <dl>
9918 <dt>t2 </dt>
9919 <dd>:d2</dd>
9920 <dt>
9921 <dl>
9922 <dt>t3 </dt>
9923 <dd>::d3</dd>
9924 </dl>
9925 </dt>
9926 </dl>
9927 </dt>
9928 </dl>
9929
9930
9931 !! end
9932
9933
9934 !! test
9935 Definition Lists: Nesting: Test 2 (Parsoid only)
9936 !! options
9937 disabled
9938 !! input
9939 ;t1
9940 ::d2
9941 !! result
9942 <dl>
9943 <dt>t1</dt>
9944 <dd>
9945 <dl>
9946 <dd>d2</dd>
9947 </dl>
9948 </dd>
9949 </dl>
9950
9951 !! end
9952
9953
9954 !! test
9955 Definition Lists: Nesting: Test 3 (Parsoid only)
9956 !! options
9957 disabled
9958 !! input
9959 :;t1
9960 ::::d2
9961 !! result
9962 <dl>
9963 <dd>
9964 <dl>
9965 <dt>t1</dt>
9966 <dd>
9967 <dl>
9968 <dd>
9969 <dl>
9970 <dd>d2</dd>
9971 </dl>
9972 </dd>
9973 </dl>
9974 </dd>
9975 </dl>
9976 </dd>
9977 </dl>
9978
9979 !! end
9980
9981
9982 !! test
9983 Definition Lists: Nesting: Test 4
9984 !! input
9985 ::;t3
9986 :::d3
9987 !! result
9988 <dl><dd><dl><dd><dl><dt>t3
9989 </dt><dd>d3
9990 </dd></dl>
9991 </dd></dl>
9992 </dd></dl>
9993
9994 !! end
9995
9996
9997 !! test
9998 Definition Lists: Mixed Lists: Test 1
9999 !! input
10000 :;* foo
10001 ::* bar
10002 :; baz
10003 !! result
10004 <dl><dd><dl><dt><ul><li> foo
10005 </li><li> bar
10006 </li></ul>
10007 </dt></dl>
10008 <dl><dt> baz
10009 </dt></dl>
10010 </dd></dl>
10011
10012 !! end
10013
10014
10015 !! test
10016 Definition Lists: Mixed Lists: Test 2
10017 !! input
10018 *: d1
10019 *: d2
10020 !! result
10021 <ul><li><dl><dd> d1
10022 </dd><dd> d2
10023 </dd></dl>
10024 </li></ul>
10025
10026 !! end
10027
10028
10029 !! test
10030 Definition Lists: Mixed Lists: Test 3
10031 !! input
10032 *::: d1
10033 *::: d2
10034 !! result
10035 <ul><li><dl><dd><dl><dd><dl><dd> d1
10036 </dd><dd> d2
10037 </dd></dl>
10038 </dd></dl>
10039 </dd></dl>
10040 </li></ul>
10041
10042 !! end
10043
10044
10045 !! test
10046 Definition Lists: Mixed Lists: Test 4
10047 !! input
10048 *;d1 :d2
10049 *;d3 :d4
10050 !! result
10051 <ul><li><dl><dt>d1&#160;</dt><dd>d2
10052 </dd><dt>d3&#160;</dt><dd>d4
10053 </dd></dl>
10054 </li></ul>
10055
10056 !! end
10057
10058
10059 !! test
10060 Definition Lists: Mixed Lists: Test 5
10061 !! input
10062 *:d1
10063 *:: d2
10064 !! result
10065 <ul><li><dl><dd>d1
10066 <dl><dd> d2
10067 </dd></dl>
10068 </dd></dl>
10069 </li></ul>
10070
10071 !! end
10072
10073
10074 !! test
10075 Definition Lists: Mixed Lists: Test 6
10076 !! input
10077 #*:d1
10078 #*::: d3
10079 !! result
10080 <ol><li><ul><li><dl><dd>d1
10081 <dl><dd><dl><dd> d3
10082 </dd></dl>
10083 </dd></dl>
10084 </dd></dl>
10085 </li></ul>
10086 </li></ol>
10087
10088 !! end
10089
10090
10091 !! test
10092 Definition Lists: Mixed Lists: Test 7
10093 !! input
10094 :* d1
10095 :* d2
10096 !! result
10097 <dl><dd><ul><li> d1
10098 </li><li> d2
10099 </li></ul>
10100 </dd></dl>
10101
10102 !! end
10103
10104
10105 !! test
10106 Definition Lists: Mixed Lists: Test 8
10107 !! input
10108 :* d1
10109 ::* d2
10110 !! result
10111 <dl><dd><ul><li> d1
10112 </li></ul>
10113 <dl><dd><ul><li> d2
10114 </li></ul>
10115 </dd></dl>
10116 </dd></dl>
10117
10118 !! end
10119
10120
10121 !! test
10122 Definition Lists: Mixed Lists: Test 9
10123 !! input
10124 *;foo :bar
10125 !! result
10126 <ul><li><dl><dt>foo&#160;</dt><dd>bar
10127 </dd></dl>
10128 </li></ul>
10129
10130 !! end
10131
10132
10133 !! test
10134 Definition Lists: Mixed Lists: Test 10
10135 !! input
10136 *#;foo :bar
10137 !! result
10138 <ul><li><ol><li><dl><dt>foo&#160;</dt><dd>bar
10139 </dd></dl>
10140 </li></ol>
10141 </li></ul>
10142
10143 !! end
10144
10145
10146 !! test
10147 Definition Lists: Mixed Lists: Test 11
10148 !! input
10149 *#*#;*;;foo :bar
10150 *#*#;boo :baz
10151 !! result
10152 <ul><li><ol><li><ul><li><ol><li><dl><dt>foo&#160;</dt><dd><ul><li><dl><dt><dl><dt>bar
10153 </dt></dl>
10154 </dd></dl>
10155 </li></ul>
10156 </dd></dl>
10157 <dl><dt>boo&#160;</dt><dd>baz
10158 </dd></dl>
10159 </li></ol>
10160 </li></ul>
10161 </li></ol>
10162 </li></ul>
10163
10164 !! end
10165
10166
10167 !! test
10168 Definition Lists: Weird Ones: Test 1
10169 !! input
10170 *#;*::;; foo : bar (who uses this?)
10171 !! result
10172 <ul><li><ol><li><dl><dt> foo&#160;</dt><dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)
10173 </dt></dl>
10174 </dd></dl>
10175 </dd></dl>
10176 </dd></dl>
10177 </li></ul>
10178 </dd></dl>
10179 </li></ol>
10180 </li></ul>
10181
10182 !! end
10183
10184 TODO:
10185 more images
10186 more tables
10187 math
10188 character entities
10189 and much more
10190 Try for 100% code coverage