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