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