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