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