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