Marked authenticateUserData() as public
[mediawiki.git] / maintenance / parserTests.txt
blob8026c83602799516be66f5369613ffd540b6178a
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 #       disabled        do not run test
24 # For testing purposes, temporary articles can created:
25 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
26 # where '/' denotes a newline.
28 # This is the standard article assumed to exist.
29 !! article
30 Main Page
31 !! text
32 blah blah
33 !! endarticle
35 ###
36 ### Basic tests
37 ###
38 !! test
39 Blank input
40 !! input
41 !! result
42 !! end
45 !! test
46 Simple paragraph
47 !! input
48 This is a simple paragraph.
49 !! result
50 <p>This is a simple paragraph.
51 </p>
52 !! end
54 !! test
55 Simple list
56 !! input
57 * Item 1
58 * Item 2
59 !! result
60 <ul><li> Item 1
61 </li><li> Item 2
62 </li></ul>
64 !! end
66 !! test
67 Italics and bold
68 !! input
69 * plain
70 * plain''italic''plain
71 * plain''italic''plain''italic''plain
72 * plain'''bold'''plain
73 * plain'''bold'''plain'''bold'''plain
74 * plain''italic''plain'''bold'''plain
75 * plain'''bold'''plain''italic''plain
76 * plain''italic'''bold-italic'''italic''plain
77 * plain'''bold''bold-italic''bold'''plain
78 * plain'''''bold-italic'''italic''plain
79 * plain'''''bold-italic''bold'''plain
80 * plain''italic'''bold-italic'''''plain
81 * plain'''bold''bold-italic'''''plain
82 * plain l'''italic''plain
83 !! result
84 <ul><li> plain
85 </li><li> plain<i>italic</i>plain
86 </li><li> plain<i>italic</i>plain<i>italic</i>plain
87 </li><li> plain<b>bold</b>plain
88 </li><li> plain<b>bold</b>plain<b>bold</b>plain
89 </li><li> plain<i>italic</i>plain<b>bold</b>plain
90 </li><li> plain<b>bold</b>plain<i>italic</i>plain
91 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
92 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
93 </li><li> plain<i><b>bold-italic</b>italic</i>plain
94 </li><li> plain<b><i>bold-italic</i>bold</b>plain
95 </li><li> plain<i>italic<b>bold-italic</b></i>plain
96 </li><li> plain<b>bold<i>bold-italic</i></b>plain
97 </li><li> plain l'<i>italic</i>plain
98 </li></ul>
100 !! end
103 ### <nowiki> test cases
106 !! test
107 <nowiki> unordered list
108 !! input
109 <nowiki>* This is not an unordered list item.</nowiki>
110 !! result
111 <p>* This is not an unordered list item.
112 </p>
113 !! end
115 !! test
116 <nowiki> spacing
117 !! input
118 <nowiki>Lorem ipsum dolor
120 sed abit.
121   sed nullum.
123 :and a colon
124 </nowiki>
125 !! result
126 <p>Lorem ipsum dolor
128 sed abit.
129   sed nullum.
131 :and a colon
133 </p>
134 !! end
136 !! test
137 nowiki 3
138 !! input
139 :There is not nowiki.
140 :There is <nowiki>nowiki</nowiki>.
142 #There is not nowiki.
143 #There is <nowiki>nowiki</nowiki>.
145 *There is not nowiki.
146 *There is <nowiki>nowiki</nowiki>.
147 !! result
148 <dl><dd>There is not nowiki.
149 </dd><dd>There is nowiki.
150 </dd></dl>
151 <ol><li>There is not nowiki.
152 </li><li>There is nowiki.
153 </li></ol>
154 <ul><li>There is not nowiki.
155 </li><li>There is nowiki.
156 </li></ul>
158 !! end
162 ### Comments
164 !! test
165 Comment test 1
166 !! input
167 <!-- comment 1 --> asdf
168 <!-- comment 2 -->
169 !! result
170 <pre>asdf
171 </pre>
173 !! end
175 !! test
176 Comment test 2
177 !! input
178 asdf
179 <!-- comment 1 -->
181 !! result
182 <p>asdf
184 </p>
185 !! end
187 !! test
188 Comment test 3
189 !! input
190 asdf
191 <!-- comment 1 -->
192 <!-- comment 2 -->
194 !! result
195 <p>asdf
197 </p>
198 !! end
200 !! test
201 Comment test 4
202 !! input
203 asdf<!-- comment 1 -->jkl
204 !! result
205 <p>asdfjkl
206 </p>
207 !! end
209 !! test
210 Comment spacing
211 !! input
213  <!-- foo --> b <!-- bar -->
215 !! result
216 <p>a
217 </p>
218 <pre> b 
219 </pre>
220 <p>c
221 </p>
222 !! end
224 !! test
225 Comment whitespace
226 !! input
227 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
228 !! result
230 !! end
232 !! test
233 Comment semantics and delimiters
234 !! input
235 <!-- --><!----><!-----><!------>
236 !! result
238 !! end
240 !! test
241 Comment semantics and delimiters, redux
242 !! input
243 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
244 -- foo -- funky huh? ... -->
245 !! result
247 !! end
249 !! test
250 Comment semantics and delimiters: directors cut
251 !! input
252 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
253 everything starting with < followed by !-- until the first -- and > we see,
254 that wouldn't be valid XML however, since in XML -- has to terminate a comment
255 -->-->
256 !! result
257 <p>-->
258 </p>
259 !! end
261 !! test
262 Comment semantics: nesting
263 !! input
264 <!--<!-- no, we're not going to do anything fancy here -->-->
265 !! result
266 <p>-->
267 </p>
268 !! end
270 !! test
271 Comment semantics: unclosed comment at end
272 !! input
273 <!--This comment will run out to the end of the document
274 !! result
276 !! end
280 ### Preformatted text
282 !! test
283 Preformatted text
284 !! input
285  This is some
286  Preformatted text
287  With ''italic''
288  And '''bold'''
289  And a [[Main Page|link]]
290 !! result
291 <pre>This is some
292 Preformatted text
293 With <i>italic</i>
294 And <b>bold</b>
295 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
296 </pre>
297 !! end
299 !! test
300 <pre> with <nowiki> inside (compatibility with 1.6 and earlier)
301 !! input
302 <pre><nowiki>
304 <cite>
305 <em>
306 </nowiki></pre>
307 !! result
308 <pre>
309 &lt;b&gt;
310 &lt;cite&gt;
311 &lt;em&gt;
312 </pre>
314 !! end
316 !! test
317 Regression with preformatted in <center>
318 !! input
319 <center>
320  Blah
321 </center>
322 !! result
323 <center>
324 <pre>Blah
325 </pre>
326 </center>
328 !! end
330 !! test
331 <pre> with attributes (bug 3202)
332 !! input
333 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
334 !! result
335 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
337 !! end
339 !! test
340 <pre> with width attribute (bug 3202)
341 !! input
342 <pre width="8">Narrow screen goodies</pre>
343 !! result
344 <pre width="8">Narrow screen goodies</pre>
346 !! end
348 !! test
349 <pre> with forbidden attribute (bug 3202)
350 !! input
351 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
352 !! result
353 <pre width="8">Narrow screen goodies</pre>
355 !! end
357 !! test
358 <pre> with forbidden attribute values (bug 3202)
359 !! input
360 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
361 !! result
362 <pre width="8">Narrow screen goodies</pre>
364 !! end
367 ### Definition lists
369 !! test
370 Simple definition
371 !! input
372 ; name : Definition
373 !! result
374 <dl><dt> name&nbsp;</dt><dd> Definition
375 </dd></dl>
377 !! end
379 !! test
380 Simple definition
381 !! input
382 : Indented text
383 !! result
384 <dl><dd> Indented text
385 </dd></dl>
387 !! end
389 !! test
390 Definition list with no space
391 !! input
392 ;name:Definition
393 !! result
394 <dl><dt>name</dt><dd>Definition
395 </dd></dl>
397 !!end
399 !! test
400 Definition list with URL link
401 !! input
402 ; http://example.com/ : definition
403 !! result
404 <dl><dt> <a href="http://example.com/" class="external free" title="http://example.com/" rel="nofollow">http://example.com/</a>&nbsp;</dt><dd> definition
405 </dd></dl>
407 !! end
409 !! test
410 Definition list with bracketed URL link
411 !! input
412 ;[http://www.example.com/ Example]:Something about it
413 !! result
414 <dl><dt><a href="http://www.example.com/" class="external text" title="http://www.example.com/" rel="nofollow">Example</a></dt><dd>Something about it
415 </dd></dl>
417 !! end
419 !! test
420 Definition list with wikilink containing colon
421 !! input
422 ; [[Help:FAQ]]: The least-read page on Wikipedia
423 !! result
424 <dl><dt> <a href="/index.php?title=Help:FAQ&amp;action=edit" class="new" title="Help:FAQ">Help:FAQ</a></dt><dd> The least-read page on Wikipedia
425 </dd></dl>
427 !! end
429 # At Brion's and JeLuF's insistence... :)
430 !! test
431 Definition list with wikilink containing colon
432 !! input
433 ;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
434 !! result
435 <dl><dt>  <a href="news:alt.wikipedia.rox" class="external free" title="news:alt.wikipedia.rox" rel="nofollow">news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
436 </dd></dl>
438 !! end
440 !! test
441 Malformed definition list with colon
442 !! input
443 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
444 !! result
445 <dl><dt>  <a href="news:alt.wikipedia.rox" class="external free" title="news:alt.wikipedia.rox" rel="nofollow">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
446 </dt></dl>
448 !! end
450 !! test
451 Definition lists: colon in external link text
452 !! input
453 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
454 !! result
455 <dl><dt> <a href="http://www.wikipedia2.org/" class="external text" title="http://www.wikipedia2.org/" rel="nofollow">Wikipedia&nbsp;: The Next Generation</a></dt><dd> OK, I made that up
456 </dd></dl>
458 !! end
460 !! test
461 Definition lists: colon in HTML attribute
462 !! input
463 ;<b style="display: inline">bold</b>
464 !! result
465 <dl><dt><b style="display: inline">bold</b>
466 </dt></dl>
468 !! end
471 !! test
472 Definition lists: self-closed tag
473 !! input
474 ;one<br/>two : two-line fun
475 !! result
476 <dl><dt>one<br />two&nbsp;</dt><dd> two-line fun
477 </dd></dl>
479 !! end
483 ### External links
485 !! test
486 External links: non-bracketed
487 !! input
488 Non-bracketed: http://example.com
489 !! result
490 <p>Non-bracketed: <a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a>
491 </p>
492 !! end
494 !! test
495 External links: numbered
496 !! input
497 Numbered: [http://example.com]
498 Numbered: [http://example.net]
499 Numbered: [http://example.org]
500 !! result
501 <p>Numbered: <a href="http://example.com" class="external autonumber" title="http://example.com" rel="nofollow">[1]</a>
502 Numbered: <a href="http://example.net" class="external autonumber" title="http://example.net" rel="nofollow">[2]</a>
503 Numbered: <a href="http://example.org" class="external autonumber" title="http://example.org" rel="nofollow">[3]</a>
504 </p>
505 !!end
507 !! test
508 External links: specified text
509 !! input
510 Specified text: [http://example.com link]
511 !! result
512 <p>Specified text: <a href="http://example.com" class="external text" title="http://example.com" rel="nofollow">link</a>
513 </p>
514 !!end
516 !! test
517 External links: trail
518 !! input
519 Linktrails should not work for external links: [http://example.com link]s
520 !! result
521 <p>Linktrails should not work for external links: <a href="http://example.com" class="external text" title="http://example.com" rel="nofollow">link</a>s
522 </p>
523 !! end
525 !! test
526 External links: dollar sign in URL
527 !! input
528 http://example.com/1$2345
529 !! result
530 <p><a href="http://example.com/1$2345" class="external free" title="http://example.com/1$2345" rel="nofollow">http://example.com/1$2345</a>
531 </p>
532 !! end
534 !! test
535 External links: dollar sign in URL (named)
536 !! input
537 [http://example.com/1$2345]
538 !! result
539 <p><a href="http://example.com/1$2345" class="external autonumber" title="http://example.com/1$2345" rel="nofollow">[1]</a>
540 </p>
541 !!end
543 !! test
544 External links: open square bracket forbidden in URL (bug 4377)
545 !! input
546 http://example.com/1[2345
547 !! result
548 <p><a href="http://example.com/1" class="external free" title="http://example.com/1" rel="nofollow">http://example.com/1</a>[2345
549 </p>
550 !! end
552 !! test
553 External links: open square bracket forbidden in URL (named) (bug 4377)
554 !! input
555 [http://example.com/1[2345]
556 !! result
557 <p><a href="http://example.com/1" class="external text" title="http://example.com/1" rel="nofollow">[2345</a>
558 </p>
559 !!end
561 !! test
562 External links: nowiki in URL link text (bug 6230)
563 !!input
564 [http://example.com/ <nowiki>''example site''</nowiki>]
565 !! result
566 <p><a href="http://example.com/" class="external text" title="http://example.com/" rel="nofollow">''example site''</a>
567 </p>
568 !! end
570 !! test
571 External links: newline forbidden in text (bug 6230 regression check)
572 !! input
573 [http://example.com/ first
574 second]
575 !! result
576 <p>[<a href="http://example.com/" class="external free" title="http://example.com/" rel="nofollow">http://example.com/</a> first
577 second]
578 </p>
579 !!end
581 !! test
582 External image
583 !! input
584 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
585 !! result
586 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
587 </p>
588 !! end
590 !! test
591 External image from https
592 !! input
593 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
594 !! result
595 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
596 </p>
597 !! end
599 !! test
600 Link to non-http image, no img tag
601 !! input
602 Link to non-http image, no img tag: ftp://example.com/test.jpg
603 !! result
604 <p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class="external free" title="ftp://example.com/test.jpg" rel="nofollow">ftp://example.com/test.jpg</a>
605 </p>
606 !! end
608 !! test
609 External links: terminating separator
610 !! input
611 Terminating separator: http://example.com/thing,
612 !! result
613 <p>Terminating separator: <a href="http://example.com/thing" class="external free" title="http://example.com/thing" rel="nofollow">http://example.com/thing</a>,
614 </p>
615 !! end
617 !! test
618 External links: intervening separator
619 !! input
620 Intervening separator: http://example.com/1,2,3
621 !! result
622 <p>Intervening separator: <a href="http://example.com/1,2,3" class="external free" title="http://example.com/1,2,3" rel="nofollow">http://example.com/1,2,3</a>
623 </p>
624 !! end
626 !! test
627 External links: old bug with URL in query
628 !! input
629 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
630 !! result
631 <p>Old bug with URL in query: <a href="http://example.com/thing?url=http://example.com" class="external text" title="http://example.com/thing?url=http://example.com" rel="nofollow">link</a>
632 </p>
633 !! end
635 !! test
636 External links: old URL-in-URL bug, mixed protocols
637 !! input
638 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
639 !! result
640 <p>And again with mixed protocols: <a href="ftp://example.com?url=http://example.com" class="external text" title="ftp://example.com?url=http://example.com" rel="nofollow">link</a>
641 </p>
642 !!end
644 !! test
645 External links: URL in text
646 !! input
647 URL in text: [http://example.com http://example.com]
648 !! result
649 <p>URL in text: <a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a>
650 </p>
651 !! end
653 !! test
654 External links: Clickable images
655 !! input
656 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
657 !! result
658 <p>ja-style clickable images: <a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
659 </p>
660 !!end
662 !! test
663 External links: raw ampersand
664 !! input
665 Old &amp; use: http://x&y
666 !! result
667 <p>Old &amp; use: <a href="http://x&amp;y" class="external free" title="http://x&amp;y" rel="nofollow">http://x&amp;y</a>
668 </p>
669 !! end
671 !! test
672 External links: encoded ampersand
673 !! input
674 Old &amp; use: http://x&amp;y
675 !! result
676 <p>Old &amp; use: <a href="http://x&amp;y" class="external free" title="http://x&amp;y" rel="nofollow">http://x&amp;y</a>
677 </p>
678 !! end
680 !! test
681 External links: encoded equals (bug 6102)
682 !! input
683 http://example.com/?foo&#61;bar
684 !! result
685 <p><a href="http://example.com/?foo=bar" class="external free" title="http://example.com/?foo=bar" rel="nofollow">http://example.com/?foo=bar</a>
686 </p>
687 !! end
689 !! test
690 External links: [raw ampersand]
691 !! input
692 Old &amp; use: [http://x&y]
693 !! result
694 <p>Old &amp; use: <a href="http://x&amp;y" class="external autonumber" title="http://x&amp;y" rel="nofollow">[1]</a>
695 </p>
696 !! end
698 !! test
699 External links: [encoded ampersand]
700 !! input
701 Old &amp; use: [http://x&amp;y]
702 !! result
703 <p>Old &amp; use: <a href="http://x&amp;y" class="external autonumber" title="http://x&amp;y" rel="nofollow">[1]</a>
704 </p>
705 !! end
707 !! test
708 External links: [encoded equals] (bug 6102)
709 !! input
710 [http://example.com/?foo&#61;bar]
711 !! result
712 <p><a href="http://example.com/?foo=bar" class="external autonumber" title="http://example.com/?foo=bar" rel="nofollow">[1]</a>
713 </p>
714 !! end
716 !! test
717 External links: [IDN ignored character reference in hostname; strip it right off]
718 !! input
719 [http://e&zwnj;xample.com/]
720 !! result
721 <p><a href="http://example.com/" class="external autonumber" title="http://example.com/" rel="nofollow">[1]</a>
722 </p>
723 !! end
725 !! test
726 External links: IDN ignored character reference in hostname; strip it right off
727 !! input
728 http://e&zwnj;xample.com/
729 !! result
730 <p><a href="http://example.com/" class="external free" title="http://example.com/" rel="nofollow">http://example.com/</a>
731 </p>
732 !! end
734 !! test
735 External links: www.jpeg.org (bug 554)
736 !! input
737 http://www.jpeg.org
738 !!result
739 <p><a href="http://www.jpeg.org" class="external free" title="http://www.jpeg.org" rel="nofollow">http://www.jpeg.org</a>
740 </p>
741 !! end
743 !! test
744 External links: URL within URL (original bug 2)
745 !! input
746 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
747 !! result
748 <p><a href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class="external autonumber" title="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" rel="nofollow">[1]</a>
749 </p>
750 !! end
752 !! test
753 BUG 361: URL inside bracketed URL
754 !! input
755 [http://www.example.com/foo http://www.example.com/bar]
756 !! result
757 <p><a href="http://www.example.com/foo" class="external text" title="http://www.example.com/foo" rel="nofollow">http://www.example.com/bar</a>
758 </p>
759 !! end
761 !! test
762 BUG 361: URL within URL, not bracketed
763 !! input
764 http://www.example.com/foo?=http://www.example.com/bar
765 !! result
766 <p><a href="http://www.example.com/foo?=http://www.example.com/bar" class="external free" title="http://www.example.com/foo?=http://www.example.com/bar" rel="nofollow">http://www.example.com/foo?=http://www.example.com/bar</a>
767 </p>
768 !! end
770 !! test
771 BUG 289: ">"-token in URL-tail
772 !! input
773 http://www.example.com/<hello>
774 !! result
775 <p><a href="http://www.example.com/" class="external free" title="http://www.example.com/" rel="nofollow">http://www.example.com/</a>&lt;hello&gt;
776 </p>
777 !!end
779 !! test
780 BUG 289: literal ">"-token in URL-tail
781 !! input
782 http://www.example.com/<b>html</b>
783 !! result
784 <p><a href="http://www.example.com/" class="external free" title="http://www.example.com/" rel="nofollow">http://www.example.com/</a><b>html</b>
785 </p>
786 !!end
788 !! test
789 BUG 289: ">"-token in bracketed URL
790 !! input
791 [http://www.example.com/<hello> stuff]
792 !! result
793 <p><a href="http://www.example.com/" class="external text" title="http://www.example.com/" rel="nofollow">&lt;hello&gt; stuff</a>
794 </p>
795 !!end
797 !! test
798 BUG 289: literal ">"-token in bracketed URL
799 !! input
800 [http://www.example.com/<b>html</b> stuff]
801 !! result
802 <p><a href="http://www.example.com/" class="external text" title="http://www.example.com/" rel="nofollow"><b>html</b> stuff</a>
803 </p>
804 !!end
806 !! test
807 BUG 289: literal double quote at end of URL
808 !! input
809 http://www.example.com/"hello"
810 !! result
811 <p><a href="http://www.example.com/" class="external free" title="http://www.example.com/" rel="nofollow">http://www.example.com/</a>"hello"
812 </p>
813 !!end
815 !! test
816 BUG 289: literal double quote in bracketed URL
817 !! input
818 [http://www.example.com/"hello" stuff]
819 !! result
820 <p><a href="http://www.example.com/" class="external text" title="http://www.example.com/" rel="nofollow">"hello" stuff</a>
821 </p>
822 !!end
824 !! test
825 External links: invalid character
826 Fixme: the missing char seems to have gone missing
827 !! options
828 disabled
829 !! input
830 [http://www.example.com  test]
831 !! result
832 <p>[<a href="http://www.example.com" class="external free" title="http://www.example.com" rel="nofollow">http://www.example.com</a>  test]
833 </p>
834 !! end
836 !! test
837 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
838 !! input
839 [http://www.example.com  test]
840 !! result
841 <p><a href="http://www.example.com" class="external text" title="http://www.example.com" rel="nofollow">test</a>
842 </p>
843 !! end
845 !! test
846 External links: wiki links within external link (Bug 3695)
847 !! input
848 [http://example.com [[wikilink]] embedded in ext link]
849 !! result
850 <p><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"></a><a href="/index.php?title=Wikilink&amp;action=edit" class="new" title="Wikilink">wikilink</a><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"> embedded in ext link</a>
851 </p>
852 !! end
854 !! test
855 BUG 787: Links with one slash after the url protocol are invalid
856 !! input
857 http:/example.com
859 [http:/example.com title]
860 !! result
861 <p>http:/example.com
862 </p><p>[http:/example.com title]
863 </p>
864 !! end
866 !! test
867 Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
868 !! input
869 ''[http://example.com text'']
870 [http://example.com '''text]'''
871 ''Something [http://example.com in italic'']
872 ''Something [http://example.com mixed''''', even bold]'''
873 '''''Now [http://example.com both''''']
874 !! result
875 <p><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><i>text</i></a>
876 <a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><b>text</b></a>
877 <i>Something </i><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><i>in italic</i></a>
878 <i>Something </i><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><i>mixed</i><b>, even bold</b></a>
879 <i><b>Now </b></i><a href="http://example.com" class="external text" title="http://example.com" rel="nofollow"><i><b>both</b></i></a>
880 </p>
881 !! end
884 !! test
885 Bug 4781: %26 in URL
886 !! input
887 http://www.example.com/?title=AT%26T
888 !! result
889 <p><a href="http://www.example.com/?title=AT%26T" class="external free" title="http://www.example.com/?title=AT%26T" rel="nofollow">http://www.example.com/?title=AT%26T</a>
890 </p>
891 !! end
893 !! test
894 Bug 4781, 5267: %26 in URL
895 !! input
896 http://www.example.com/?title=100%25_Bran
897 !! result
898 <p><a href="http://www.example.com/?title=100%25_Bran" class="external free" title="http://www.example.com/?title=100%25_Bran" rel="nofollow">http://www.example.com/?title=100%25_Bran</a>
899 </p>
900 !! end
902 !! test
903 Bug 4781, 5267: %28, %29 in URL
904 !! input
905 http://www.example.com/?title=Ben-Hur_%281959_film%29
906 !! result
907 <p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external free" title="http://www.example.com/?title=Ben-Hur_%281959_film%29" rel="nofollow">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
908 </p>
909 !! end
912 !! test
913 Bug 4781: %26 in autonumber URL
914 !! input
915 [http://www.example.com/?title=AT%26T]
916 !! result
917 <p><a href="http://www.example.com/?title=AT%26T" class="external autonumber" title="http://www.example.com/?title=AT%26T" rel="nofollow">[1]</a>
918 </p>
919 !! end
921 !! test
922 Bug 4781, 5267: %26 in autonumber URL
923 !! input
924 [http://www.example.com/?title=100%25_Bran]
925 !! result
926 <p><a href="http://www.example.com/?title=100%25_Bran" class="external autonumber" title="http://www.example.com/?title=100%25_Bran" rel="nofollow">[1]</a>
927 </p>
928 !! end
930 !! test
931 Bug 4781, 5267: %28, %29 in autonumber URL
932 !! input
933 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
934 !! result
935 <p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external autonumber" title="http://www.example.com/?title=Ben-Hur_%281959_film%29" rel="nofollow">[1]</a>
936 </p>
937 !! end
940 !! test
941 Bug 4781: %26 in bracketed URL
942 !! input
943 [http://www.example.com/?title=AT%26T link]
944 !! result
945 <p><a href="http://www.example.com/?title=AT%26T" class="external text" title="http://www.example.com/?title=AT%26T" rel="nofollow">link</a>
946 </p>
947 !! end
949 !! test
950 Bug 4781, 5267: %26 in bracketed URL
951 !! input
952 [http://www.example.com/?title=100%25_Bran link]
953 !! result
954 <p><a href="http://www.example.com/?title=100%25_Bran" class="external text" title="http://www.example.com/?title=100%25_Bran" rel="nofollow">link</a>
955 </p>
956 !! end
958 !! test
959 Bug 4781, 5267: %28, %29 in bracketed URL
960 !! input
961 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
962 !! result
963 <p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external text" title="http://www.example.com/?title=Ben-Hur_%281959_film%29" rel="nofollow">link</a>
964 </p>
965 !! end
967 !! test
968 External link containing double-single-quotes in text '' (bug 4598 sanity check)
969 !! input
970 Some [http://example.com/ pretty ''italics'' and stuff]!
971 !! result
972 <p>Some <a href="http://example.com/" class="external text" title="http://example.com/" rel="nofollow">pretty <i>italics</i> and stuff</a>!
973 </p>
974 !! end
976 !! test
977 External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check)
978 !! input
979 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
980 !! result
981 <p><i>Some </i><a href="http://example.com/" class="external text" title="http://example.com/" rel="nofollow"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
982 </p>
983 !! end
988 ### Quotes
991 !! test
992 Quotes
993 !! input
994 Normal text. '''Bold text.''' Normal text. ''Italic text.''
996 Normal text. '''''Bold italic text.''''' Normal text.
997 !!result
998 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
999 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
1000 </p>
1001 !! end
1004 !! test
1005 Unclosed and unmatched quotes
1006 !! input
1007 '''''Bold italic text '''with bold deactivated''' in between.'''''
1009 '''''Bold italic text ''with italic deactivated'' in between.'''''
1011 '''Bold text..
1013 ..spanning two paragraphs (should not work).'''
1015 '''Bold tag left open
1017 ''Italic tag left open
1019 Normal text.
1021 <!-- Unmatching number of opening, closing tags: -->
1022 '''This year''''s election ''should'' beat '''last year''''s.
1024 ''Tom'''s car is bigger than ''Susan'''s.
1025 !! result
1026 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
1027 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
1028 </p><p><b>Bold text..</b>
1029 </p><p>..spanning two paragraphs (should not work).
1030 </p><p><b>Bold tag left open</b>
1031 </p><p><i>Italic tag left open</i>
1032 </p><p>Normal text.
1033 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
1034 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
1035 </p>
1036 !! end
1039 ### Tables
1041 ### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
1044 # This should not produce <table></table> as <table><tr><td></td></tr></table>
1045 # is the bare minimun required by the spec, see:
1046 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
1047 !! test
1048 A table with no data.
1049 !! input
1050 {||}
1051 !! result
1052 !! end
1054 # A table with nothing but a caption is invalid XHTML, we might want to render
1055 # this as <p>caption</p>
1056 !! test
1057 A table with nothing but a caption
1058 !! input 
1060 |+ caption
1062 !! result
1063 <table>
1064 <caption> caption
1065 </caption><tr><td></td></tr></table>
1067 !! end
1069 !! test
1070 Simple table
1071 !! input
1072 {| 
1073 | 1 || 2
1074 |- 
1075 | 3 || 4
1077 !! result
1078 <table>
1079 <tr>
1080 <td> 1 </td><td> 2
1081 </td></tr>
1082 <tr>
1083 <td> 3 </td><td> 4
1084 </td></tr></table>
1086 !! end
1088 !! test
1089 Multiplication table
1090 !! input
1091 {| border="1" cellpadding="2"
1092 |+Multiplication table
1094 ! &times; !! 1 !! 2 !! 3
1096 ! 1
1097 | 1 || 2 || 3
1099 ! 2
1100 | 2 || 4 || 6
1102 ! 3
1103 | 3 || 6 || 9
1105 ! 4
1106 | 4 || 8 || 12
1108 ! 5
1109 | 5 || 10 || 15
1111 !! result
1112 <table border="1" cellpadding="2">
1113 <caption>Multiplication table
1114 </caption>
1115 <tr>
1116 <th> &times; </th><th> 1 </th><th> 2 </th><th> 3
1117 </th></tr>
1118 <tr>
1119 <th> 1
1120 </th><td> 1 </td><td> 2 </td><td> 3
1121 </td></tr>
1122 <tr>
1123 <th> 2
1124 </th><td> 2 </td><td> 4 </td><td> 6
1125 </td></tr>
1126 <tr>
1127 <th> 3
1128 </th><td> 3 </td><td> 6 </td><td> 9
1129 </td></tr>
1130 <tr>
1131 <th> 4
1132 </th><td> 4 </td><td> 8 </td><td> 12
1133 </td></tr>
1134 <tr>
1135 <th> 5
1136 </th><td> 5 </td><td> 10 </td><td> 15
1137 </td></tr></table>
1139 !! end
1141 !! test
1142 Table rowspan
1143 !! input
1144 {| align=right border=1
1145 | Cell 1, row 1 
1146 |rowspan=2| Cell 2, row 1 (and 2) 
1147 | Cell 3, row 1 
1148 |- 
1149 | Cell 1, row 2 
1150 | Cell 3, row 2 
1152 !! result
1153 <table align="right" border="1">
1154 <tr>
1155 <td> Cell 1, row 1
1156 </td><td rowspan="2"> Cell 2, row 1 (and 2)
1157 </td><td> Cell 3, row 1
1158 </td></tr>
1159 <tr>
1160 <td> Cell 1, row 2
1161 </td><td> Cell 3, row 2
1162 </td></tr></table>
1164 !! end
1166 !! test
1167 Nested table
1168 !! input
1169 {| border=1
1170 | &alpha;
1172 {| bgcolor=#ABCDEF border=2
1173 |nested
1175 |table
1177 |the original table again
1179 !! result
1180 <table border="1">
1181 <tr>
1182 <td> &alpha;
1183 </td><td>
1184 <table bgcolor="#ABCDEF" border="2">
1185 <tr>
1186 <td>nested
1187 </td></tr>
1188 <tr>
1189 <td>table
1190 </td></tr></table>
1191 </td><td>the original table again
1192 </td></tr></table>
1194 !! end
1196 !! test
1197 Invalid attributes in table cell (bug 1830)
1198 !! input
1200 |Cell:|broken
1202 !! result
1203 <table>
1204 <tr>
1205 <td>broken
1206 </td></tr></table>
1208 !! end
1211 # FIXME: this one has incorrect tag nesting still.
1212 !! test
1213 TODO: Table security: embedded pipes (http://mail.wikipedia.org/pipermail/wikitech-l/2006-April/034637.html)
1214 !! input
1216 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
1217 !! result
1218 <table>
1219 <tr>
1220 <td><a href="ftp://|x||" class="external autonumber" title="ftp://|x||" rel="nofollow">[1]</td><td></a>" onmouseover="alert(document.cookie)">test
1221 </td>
1222 </tr>
1223 </table>
1225 !! end
1229 ### Internal links
1231 !! test
1232 Plain link, capitalized
1233 !! input
1234 [[Main Page]]
1235 !! result
1236 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1237 </p>
1238 !! end
1240 !! test
1241 Plain link, uncapitalized
1242 !! input
1243 [[main Page]]
1244 !! result
1245 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
1246 </p>
1247 !! end
1249 !! test
1250 Piped link
1251 !! input
1252 [[Main Page|The Main Page]]
1253 !! result
1254 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
1255 </p>
1256 !! end
1258 !! test
1259 Broken link
1260 !! input
1261 [[Zigzagzogzagzig]]
1262 !! result
1263 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
1264 </p>
1265 !! end
1267 !! test
1268 Link with prefix
1269 !! input
1270 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
1271 !! result
1272 <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>
1273 </p>
1274 !! end
1276 !! test
1277 Link with suffix
1278 !! input
1279 [[Main Page]]xxx, [[Main Page]]XXX
1280 !! result
1281 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
1282 </p>
1283 !! end
1285 !! test
1286 Link with 3 brackets
1287 !! input
1288 [[[main page]]]
1289 !! result
1290 <p>[[[main page]]]
1291 </p>
1292 !! end
1294 !! test
1295 Piped link with 3 brackets
1296 !! input
1297 [[[main page|the main page]]]
1298 !! result
1299 <p>[[[main page|the main page]]]
1300 </p>
1301 !! end
1303 !! test
1304 Link with multiple pipes
1305 !! input
1306 [[Main Page|The|Main|Page]]
1307 !! result
1308 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
1309 </p>
1310 !! end
1312 !! test
1313 Link to namespaces
1314 !! input
1315 [[Talk:Parser testing]], [[Meta:Disclaimers]]
1316 !! result
1317 <p><a href="/index.php?title=Talk:Parser_testing&amp;action=edit" class="new" title="Talk:Parser testing">Talk:Parser testing</a>, <a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">Meta:Disclaimers</a>
1318 </p>
1319 !! end
1321 !! test
1322 Piped link to namespace
1323 !! input
1324 [[Meta:Disclaimers|The disclaimers]]
1325 !! result
1326 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
1327 </p>
1328 !! end
1330 !! test
1331 Link containing }
1332 !! input
1333 [[Usually caused by a typo (oops}]]
1334 !! result
1335 <p>[[Usually caused by a typo (oops}]]
1336 </p>
1337 !! end
1339 !! test
1340 Link containing % (not as a hex sequence)
1341 !! input
1342 [[7% Solution]]
1343 !! result
1344 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
1345 </p>
1346 !! end
1348 !! test
1349 Link containing % as a single hex sequence interpreted to char
1350 !! input
1351 [[7%25 Solution]]
1352 !! result
1353 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
1354 </p>
1355 !!end
1357 !! test
1358 Link containing % as a double hex sequence interpreted to hex sequence
1359 !! input
1360 [[7%2525 Solution]]
1361 !! result
1362 <p>[[7%2525 Solution]]
1363 </p>
1364 !!end
1366 !! test
1367 Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
1368 Example for such a section: == < ==
1369 !! input
1370 [[%23%3c]][[%23%3e]]
1371 !! result
1372 <p><a href="#.3C" title="">#&lt;</a><a href="#.3E" title="">#&gt;</a>
1373 </p>
1374 !! end
1376 !! test
1377 Link containing "<#" and ">#" as a hex sequences
1378 !! input
1379 [[%3c%23]][[%3e%23]]
1380 !! result
1381 <p>[[%3c%23]][[%3e%23]]
1382 </p>
1383 !! end
1385 !! test
1386 TODO: Link containing double-single-quotes '' (bug 4598)
1387 !! input
1388 [[Lista d''e paise d''o munno]]
1389 !! result
1390 <p><a href="/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit" class="new" title="Lista d''e paise d''o munno">Lista d''e paise d''o munno</a>
1391 </p>
1392 !! end
1394 !! test
1395 Link containing double-single-quotes '' in text (bug 4598 sanity check)
1396 !! input
1397 Some [[Link|pretty ''italics'' and stuff]]!
1398 !! result
1399 <p>Some <a href="/index.php?title=Link&amp;action=edit" class="new" title="Link">pretty <i>italics</i> and stuff</a>!
1400 </p>
1401 !! end
1403 !! test
1404 Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check)
1405 !! input
1406 ''Some [[Link|pretty ''italics'' and stuff]]!
1407 !! result
1408 <p><i>Some </i><a href="/index.php?title=Link&amp;action=edit" class="new" title="Link"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
1409 </p>
1410 !! end
1412 !! test
1413 Plain link to URL
1414 !! input
1415 [[http://www.example.org]]
1416 !! result
1417 <p>[<a href="http://www.example.org" class="external autonumber" title="http://www.example.org" rel="nofollow">[1]</a>]
1418 </p>
1419 !! end
1421 # I'm fairly sure the expected result here is wrong.
1422 # We want these to be URL links, not pseudo-pages with URLs for titles....
1423 # However the current output is also pretty screwy.
1425 # ----
1426 # I'm changing it to match the current output--it arguably makes more
1427 # sense in the light of the test above. Old expected result was:
1428 #<p>Piped link to URL: <a href="/index.php?title=Http://www.example.org&amp;action=edit" class="new" title="Http://www.example.org">an example URL</a>
1429 #</p>
1430 # But I think this test is bordering on "garbage in, garbage out" anyway.
1431 # -- wtm
1432 !! test
1433 Piped link to URL
1434 !! input
1435 Piped link to URL: [[http://www.example.org|an example URL]]
1436 !! result
1437 <p>Piped link to URL: [<a href="http://www.example.org|an" class="external text" title="http://www.example.org|an" rel="nofollow">example URL</a>]
1438 </p>
1439 !! end
1441 !! test
1442 BUG 2: [[page|http://url/]] should link to page, not http://url/
1443 !! input
1444 [[Main Page|http://url/]]
1445 !! result
1446 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
1447 </p>
1448 !! end
1450 !! test
1451 BUG 337: Escaped self-links should be bold
1452 !! options
1453 title=[[Bug462]]
1454 !! input
1455 [[Bu&#103;462]] [[Bug462]]
1456 !! result
1457 <p><strong class="selflink">Bu&#103;462</strong> <strong class="selflink">Bug462</strong>
1458 </p>
1459 !! end
1461 !! test
1462 Self-link to section should not be bold
1463 !! options
1464 title=[[Main Page]]
1465 !! input
1466 [[Main Page#section]]
1467 !! result
1468 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
1469 </p>
1470 !! end
1472 !! test
1473 <nowiki> inside a link
1474 !! input
1475 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
1476 !! result
1477 <p>[[Main Page]] <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
1478 </p>
1479 !! end
1482 ### Interwiki links (see maintenance/interwiki.sql)
1485 !! test
1486 Inline interwiki link
1487 !! input
1488 [[MeatBall:SoftSecurity]]
1489 !! result
1490 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
1491 </p>
1492 !! end
1494 !! test
1495 Inline interwiki link with empty title (bug 2372)
1496 !! input
1497 [[MeatBall:]]
1498 !! result
1499 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class="extiw" title="meatball:">MeatBall:</a>
1500 </p>
1501 !! end
1503 !! test
1504 Interwiki link encoding conversion (bug 1636)
1505 !! input
1506 *[[Wikipedia:ro:Olteni&#0355;a]]
1507 *[[Wikipedia:ro:Olteni&#355;a]]
1508 !! result
1509 <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>
1510 </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>
1511 </li></ul>
1513 !! end
1515 !! test
1516 Interwiki link with fragment (bug 2130)
1517 !! input
1518 [[MeatBall:SoftSecurity#foo]]
1519 !! result
1520 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
1521 </p>
1522 !! end
1525 ## XHTML tidiness
1528 !! test
1529 <br> to <br />
1530 !! input
1531 1<br>2<br />3
1532 !! result
1533 <p>1<br />2<br />3
1534 </p>
1535 !! end
1537 !! test
1538 Incorrecly removing closing slashes from correctly formed XHTML
1539 !! input
1540 <br style="clear:both;" />
1541 !! result
1542 <p><br style="clear:both;" />
1543 </p>
1544 !! end
1546 !! test 
1547 Failing to transform badly formed HTML into correct XHTML
1548 !! input
1549 <br clear=left>
1550 <br clear=right>
1551 <br clear=all>
1552 !! result
1553 <p><br clear="left" />
1554 <br clear="right" />
1555 <br clear="all" />
1556 </p>
1557 !!end
1559 !! test 
1560 Horizontal ruler (should it add that extra space?)
1561 !! input 
1562 <hr>
1563 <hr >
1564 foo <hr
1565 > bar
1566 !! result 
1567 <hr />
1568 <hr />
1569 foo <hr /> bar
1571 !! end
1574 ### Block-level elements
1576 !! test
1577 Common list
1578 !! input
1579 *Common list
1580 * item 2
1581 *item 3
1582 !! result
1583 <ul><li>Common list
1584 </li><li> item 2
1585 </li><li>item 3
1586 </li></ul>
1588 !! end
1590 !! test
1591 Numbered list
1592 !! input
1593 #Numbered list
1594 #item 2
1595 # item 3
1596 !! result
1597 <ol><li>Numbered list
1598 </li><li>item 2
1599 </li><li> item 3
1600 </li></ol>
1602 !! end
1604 !! test
1605 Mixed list
1606 !! input
1607 *Mixed list
1608 *# with numbers
1609 ** and bullets
1610 *# and numbers
1611 *bullets again
1612 **bullet level 2
1613 ***bullet level 3
1614 ***#Number on level 4
1615 **bullet level 2
1616 **#Number on level 3
1617 **#Number on level 3
1618 *#number level 2
1619 *Level 1
1620 !! result
1621 <ul><li>Mixed list
1622 <ol><li> with numbers
1623 </li></ol>
1624 <ul><li> and bullets
1625 </li></ul>
1626 <ol><li> and numbers
1627 </li></ol>
1628 </li><li>bullets again
1629 <ul><li>bullet level 2
1630 <ul><li>bullet level 3
1631 <ol><li>Number on level 4
1632 </li></ol>
1633 </li></ul>
1634 </li><li>bullet level 2
1635 <ol><li>Number on level 3
1636 </li><li>Number on level 3
1637 </li></ol>
1638 </li></ul>
1639 <ol><li>number level 2
1640 </li></ol>
1641 </li><li>Level 1
1642 </li></ul>
1644 !! end
1646 !! test
1647 List items are not parsed correctly following a <pre> block (bug 785)
1648 !! input
1649 * <pre>foo</pre>
1650 * <pre>bar</pre>
1651 * zar
1652 !! result
1653 <ul><li> <pre>foo</pre>
1654 </li><li> <pre>bar</pre>
1655 </li><li> zar
1656 </li></ul>
1658 !! end
1661 ### Magic Words
1664 !! test
1665 Magic Word: {{CURRENTDAY}}
1666 !! input
1667 {{CURRENTDAY}}
1668 !! result
1669 <p>1
1670 </p>
1671 !! end
1673 !! test
1674 Magic Word: {{CURRENTDAY2}}
1675 !! input
1676 {{CURRENTDAY2}}
1677 !! result
1678 <p>01
1679 </p>
1680 !! end
1682 !! test
1683 Magic Word: {{CURRENTDAYNAME}}
1684 !! input
1685 {{CURRENTDAYNAME}}
1686 !! result
1687 <p>Thursday
1688 </p>
1689 !! end
1691 !! test
1692 Magic Word: {{CURRENTDOW}}
1693 !! input
1694 {{CURRENTDOW}}
1695 !! result
1696 <p>4
1697 </p>
1698 !! end
1700 !! test
1701 Magic Word: {{CURRENTMONTH}}
1702 !! input
1703 {{CURRENTMONTH}}
1704 !! result
1705 <p>01
1706 </p>
1707 !! end
1709 !! test
1710 Magic Word: {{CURRENTMONTHABBREV}}
1711 !! input
1712 {{CURRENTMONTHABBREV}}
1713 !! result
1714 <p>Jan
1715 </p>
1716 !! end
1718 !! test
1719 Magic Word: {{CURRENTMONTHNAME}}
1720 !! input
1721 {{CURRENTMONTHNAME}}
1722 !! result
1723 <p>January
1724 </p>
1725 !! end
1727 !! test
1728 Magic Word: {{CURRENTMONTHNAMEGEN}}
1729 !! input
1730 {{CURRENTMONTHNAMEGEN}}
1731 !! result
1732 <p>January
1733 </p>
1734 !! end
1736 !! test
1737 Magic Word: {{CURRENTTIME}}
1738 !! input
1739 {{CURRENTTIME}}
1740 !! result
1741 <p>00:02
1742 </p>
1743 !! end
1745 !! test
1746 Magic Word: {{CURRENTWEEK}} (@bug 4594)
1747 !! input
1748 {{CURRENTWEEK}}
1749 !! result
1750 <p>1
1751 </p>
1752 !! end
1754 !! test
1755 Magic Word: {{CURRENTYEAR}}
1756 !! input
1757 {{CURRENTYEAR}}
1758 !! result
1759 <p>1970
1760 </p>
1761 !! end
1763 !! test
1764 Magic Word: {{FULLPAGENAME}}
1765 !! options
1766 title=[[User:Ævar Arnfjörð Bjarmason]]
1767 !! input
1768 {{FULLPAGENAME}}
1769 !! result
1770 <p>User:Ævar Arnfjörð Bjarmason
1771 </p>
1772 !! end
1774 !! test
1775 Magic Word: {{FULLPAGENAMEE}}
1776 !! options
1777 title=[[User:Ævar Arnfjörð Bjarmason]]
1778 !! input
1779 {{FULLPAGENAMEE}}
1780 !! result
1781 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
1782 </p>
1783 !! end
1785 !! test
1786 Magic Word: {{NAMESPACE}}
1787 !! options
1788 title=[[User:Ævar Arnfjörð Bjarmason]]
1789 disabled # FIXME
1790 !! input
1791 {{NAMESPACE}}
1792 !! result
1793 <p>User
1794 </p>
1795 !! end
1797 !! test
1798 Magic Word: {{NAMESPACEE}}
1799 !! options
1800 title=[[User:Ævar Arnfjörð Bjarmason]]
1801 disabled # FIXME
1802 !! input
1803 {{NAMESPACEE}}
1804 !! result
1805 <p>User
1806 </p>
1807 !! end
1809 !! test
1810 Magic Word: {{NUMBEROFARTICLES}}
1811 !! input
1812 {{NUMBEROFARTICLES}}
1813 !! result
1814 <p>1
1815 </p>
1816 !! end
1818 !! test
1819 Magic Word: {{NUMBEROFFILES}}
1820 !! input
1821 {{NUMBEROFFILES}}
1822 !! result
1823 <p>1
1824 </p>
1825 !! end
1827 !! test
1828 Magic Word: {{PAGENAME}}
1829 !! options
1830 title=[[User:Ævar Arnfjörð Bjarmason]]
1831 disabled # FIXME
1832 !! input
1833 {{PAGENAME}}
1834 !! result
1835 <p>Ævar Arnfjörð Bjarmason
1836 </p>
1837 !! end
1839 !! test
1840 Magic Word: {{PAGENAMEE}}
1841 !! options
1842 title=[[User:Ævar Arnfjörð Bjarmason]]
1843 !! input
1844 {{PAGENAMEE}}
1845 !! result
1846 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
1847 </p>
1848 !! end
1850 !! test
1851 Magic Word: {{REVISIONID}}
1852 !! input
1853 {{REVISIONID}}
1854 !! result
1855 <p>1337
1856 </p>
1857 !! end
1859 !! test
1860 Magic Word: {{SCRIPTPATH}}
1861 !! input
1862 {{SCRIPTPATH}}
1863 !! result
1864 <p>/
1865 </p>
1866 !! end
1868 !! test
1869 Magic Word: {{SERVER}}
1870 !! input
1871 {{SERVER}}
1872 !! result
1873 <p><a href="http://localhost" class="external free" title="http://localhost" rel="nofollow">http://localhost</a>
1874 </p>
1875 !! end
1877 !! test
1878 Magic Word: {{SERVERNAME}}
1879 !! input
1880 {{SERVERNAME}}
1881 !! result
1882 <p>Britney Spears
1883 </p>
1884 !! end
1886 !! test
1887 Magic Word: {{SITENAME}}
1888 !! input
1889 {{SITENAME}}
1890 !! result
1891 <p>MediaWiki
1892 </p>
1893 !! end
1895 !! test
1896 Namespace 1 {{ns:1}}
1897 !! input
1898 {{ns:1}}
1899 !! result
1900 <p>Talk
1901 </p>
1902 !! end
1904 !! test
1905 Namespace 1 {{ns:01}}
1906 !! input
1907 {{ns:01}}
1908 !! result
1909 <p>Talk
1910 </p>
1911 !! end
1913 !! test
1914 Namespace 0 {{ns:0}} (bug 4783)
1915 !! input
1916 {{ns:0}}
1917 !! result
1919 !! end
1921 !! test
1922 Namespace 0 {{ns:00}} (bug 4783)
1923 !! input
1924 {{ns:00}}
1925 !! result
1927 !! end
1929 !! test
1930 Namespace -1 {{ns:-1}}
1931 !! input
1932 {{ns:-1}}
1933 !! result
1934 <p>Special
1935 </p>
1936 !! end
1938 !! test
1939 Namespace Project {{ns:User}}
1940 !! input
1941 {{ns:User}}
1942 !! result
1943 <p>User
1944 </p>
1945 !! end
1949 ### Magic links
1951 !! test
1952 Magic links: internal link to RFC (bug 479)
1953 !! input
1954 [[RFC 123]]
1955 !! result
1956 <p><a href="/index.php?title=RFC_123&amp;action=edit" class="new" title="RFC 123">RFC 123</a>
1957 </p>
1958 !! end
1960 !! test
1961 Magic links: RFC (bug 479)
1962 !! input
1963 RFC 822
1964 !! result
1965 <p><a href="http://www.ietf.org/rfc/rfc822.txt" class="external" title="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>
1966 </p>
1967 !! end
1969 !! test
1970 Magic links: ISBN (bug 1937)
1971 !! input
1972 ISBN 0-306-40615-2
1973 !! result
1974 <p><a href="/index.php?title=Special:Booksources&amp;isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1975 </p>
1976 !! end
1978 !! test
1979 Magic links: PMID incorrectly converts space to underscore
1980 !! input
1981 PMID 1234
1982 !! result
1983 <p><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=pubmed&amp;dopt=Abstract&amp;list_uids=1234" class="external" title="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=pubmed&amp;dopt=Abstract&amp;list_uids=1234">PMID 1234</a>
1984 </p>
1985 !! end
1988 ### Templates
1989 ####
1991 !! test
1992 Nonexistant template
1993 !! input
1994 {{thistemplatedoesnotexist}}
1995 !! result
1996 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1997 </p>
1998 !! end
2000 !! article
2001 Template:test
2002 !! text
2003 This is a test template
2004 !! endarticle
2006 !! test
2007 Simple template
2008 !! input
2009 {{test}}
2010 !! result
2011 <p>This is a test template
2012 </p>
2013 !! end
2015 !! test
2016 Template with explicit namespace
2017 !! input
2018 {{Template:test}}
2019 !! result
2020 <p>This is a test template
2021 </p>
2022 !! end
2025 !! article
2026 Template:paramtest
2027 !! text
2028 This is a test template with parameter {{{param}}}
2029 !! endarticle
2031 !! test
2032 Template parameter
2033 !! input
2034 {{paramtest|param=foo}}
2035 !! result
2036 <p>This is a test template with parameter foo
2037 </p>
2038 !! end
2040 !! article
2041 Template:paramtestnum
2042 !! text
2043 [[{{{1}}}|{{{2}}}]]
2044 !! endarticle
2046 !! test
2047 Template unnamed parameter
2048 !! input
2049 {{paramtestnum|Main Page|the main page}}
2050 !! result
2051 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
2052 </p>
2053 !! end
2055 !! article
2056 Template:templatesimple
2057 !! text
2058 (test)
2059 !! endarticle
2061 !! article
2062 Template:templateredirect
2063 !! text
2064 #redirect [[Template:templatesimple]]
2065 !! endarticle
2067 !! article
2068 Template:templateasargtestnum
2069 !! text
2070 {{{{{1}}}}}
2071 !! endarticle
2073 !! article
2074 Template:templateasargtest
2075 !! text
2076 {{template{{{templ}}}}}
2077 !! endarticle
2079 !! article
2080 Template:templateasargtest2
2081 !! text
2082 {{{{{templ}}}}}
2083 !! endarticle
2085 !! test
2086 Template with template name as unnamed argument
2087 !! input
2088 {{templateasargtestnum|templatesimple}}
2089 !! result
2090 <p>(test)
2091 </p>
2092 !! end
2094 !! test
2095 Template with template name as argument
2096 !! input
2097 {{templateasargtest|templ=simple}}
2098 !! result
2099 <p>(test)
2100 </p>
2101 !! end
2103 !! test
2104 Template with template name as argument (2)
2105 !! input
2106 {{templateasargtest2|templ=templatesimple}}
2107 !! result
2108 <p>(test)
2109 </p>
2110 !! end
2112 !! article
2113 Template:templateasargtestdefault
2114 !! text
2115 {{{{{templ|templatesimple}}}}}
2116 !! endarticle
2118 !! article
2119 Template:templa
2120 !! text
2121 '''templ'''
2122 !! endarticle
2124 !! test
2125 Template with default value
2126 !! input
2127 {{templateasargtestdefault}}
2128 !! result
2129 <p>(test)
2130 </p>
2131 !! end
2133 !! test
2134 Template with default value (value set)
2135 !! input
2136 {{templateasargtestdefault|templ=templa}}
2137 !! result
2138 <p><b>templ</b>
2139 </p>
2140 !! end
2142 !! test
2143 Template redirect
2144 !! input
2145 {{templateredirect}}
2146 !! result
2147 <p>(test)
2148 </p>
2149 !! end
2151 !! test
2152 Template with argument in separate line
2153 !! input
2154 {{ templateasargtest  |
2155  templ = simple }}
2156 !! result
2157 <p>(test)
2158 </p>
2159 !! end
2161 !! test
2162 Template with complex template as argument
2163 !! input
2164 {{paramtest|
2165   param ={{ templateasargtest  |
2166  templ = simple }}}}
2167 !! result
2168 <p>This is a test template with parameter (test)
2169 </p>
2170 !! end
2172 !! test
2173 TODO: Template with thumb image (with link in description)
2174 !! input
2175 {{paramtest|
2176   param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
2177 !! result
2178 This is a test template with parameter <div class="thumb tright"><div style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="Image:Noimage.png">Image:Noimage.png</a>  <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit" class="new" title="No link">link</a> <a href="/index.php?title=No_link&amp;action=edit" class="new" title="No link">caption</a></div></div></div>
2180 !! end
2182 !! article
2183 Template:complextemplate
2184 !! text
2185 {{{1}}} {{paramtest|
2186   param ={{{param}}}}}
2187 !! endarticle
2189 !! test
2190 Template with complex arguments
2191 !! input
2192 {{complextemplate|
2193   param ={{ templateasargtest  |
2194  templ = simple }}|[[Template:complextemplate|link]]}}
2195 !! result
2196 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
2197 </p>
2198 !! end
2200 !! test
2201 BUG 553: link with two variables in a piped link
2202 !! input
2203 {| 
2204 |[[{{{1}}}|{{{2}}}]]
2206 !! result
2207 <table>
2208 <tr>
2209 <td>[[{{{1}}}|{{{2}}}]]
2210 </td></tr></table>
2212 !! end
2214 !! test
2215 Magic variable as template parameter
2216 !! input
2217 {{paramtest|param={{SITENAME}}}}
2218 !! result
2219 <p>This is a test template with parameter MediaWiki
2220 </p>
2221 !! end
2223 !! article
2224 Template:linktest
2225 !! text
2226 [[{{{param}}}|link]]
2227 !! endarticle
2229 !! test
2230 Template parameter as link source
2231 !! input
2232 {{linktest|param=Main Page}}
2233 !! result
2234 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
2235 </p>
2236 !! end
2239 !!article
2240 Template:paramtest2
2241 !! text
2242 including another template, {{paramtest|param={{{arg}}}}}
2243 !! endarticle
2245 !! test
2246 Template passing argument to another template
2247 !! input
2248 {{paramtest2|arg='hmm'}}
2249 !! result
2250 <p>including another template, This is a test template with parameter 'hmm'
2251 </p>
2252 !! end
2254 !! article
2255 Template:Linktest2
2256 !! text
2257 Main Page
2258 !! endarticle
2260 !! test
2261 Template as link source
2262 !! input
2263 [[{{linktest2}}]]
2264 !! result
2265 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
2266 </p>
2267 !! end
2270 !! article
2271 Template:loop1
2272 !! text
2273 {{loop2}}
2274 !! endarticle
2276 !! article
2277 Template:loop2
2278 !! text
2279 {{loop1}}
2280 !! endarticle
2282 !! test
2283 Template infinite loop
2284 !! input
2285 {{loop1}}
2286 !! result
2287 <p><a href="/index.php?title=Loop1&amp;action=edit" class="new" title="Loop1">loop1</a><!-- WARNING: template loop detected -->
2288 </p>
2289 !! end
2291 !! test
2292 Template from main namespace
2293 !! input
2294 {{:Main Page}}
2295 !! result
2296 <p>blah blah
2297 </p>
2298 !! end
2300 !! article
2301 Template:table
2302 !! text
2303 {| 
2304 | 1 || 2
2305 |- 
2306 | 3 || 4
2308 !! endarticle
2310 !! test
2311 BUG 529: Template with table, not included at beginning of line
2312 !! input
2313 foo {{table}}
2314 !! result
2315 <p>foo 
2316 </p>
2317 <table>
2318 <tr>
2319 <td> 1 </td><td> 2
2320 </td></tr>
2321 <tr>
2322 <td> 3 </td><td> 4
2323 </td></tr></table>
2325 !! end
2327 !! test
2328 BUG 523: Template shouldn't eat newline (or add an extra one before table)
2329 !! input
2331 {{table}}
2332 !! result
2333 <p>foo
2334 </p>
2335 <table>
2336 <tr>
2337 <td> 1 </td><td> 2
2338 </td></tr>
2339 <tr>
2340 <td> 3 </td><td> 4
2341 </td></tr></table>
2343 !! end
2345 !! test
2346 BUG 41: Template parameters shown as broken links
2347 !! input
2348 {{{parameter}}}
2349 !! result
2350 <p>{{{parameter}}}
2351 </p>
2352 !! end
2355 !! article
2356 Template:MSGNW test
2357 !! text
2358 ''None'' of '''this''' should be 
2359 * interepreted
2360  but rather passed unmodified
2361 {{test}}
2362 !! endarticle
2364 # hmm, fix this or just deprecate msgnw and document its behavior?
2365 !! test
2366 msgnw keyword
2367 !! options
2368 disabled
2369 !! input
2370 {{msgnw:MSGNW test}}
2371 !! result
2372 <p>''None'' of '''this''' should be 
2373 * interepreted
2374  but rather passed unmodified
2375 {{test}}
2376 </p>
2377 !! end
2379 !! test
2380 int keyword
2381 !! input
2382 {{int:youhavenewmessages|lots of money|not!}}
2383 !! result
2384 <p>You have lots of money (not!).
2385 </p>
2386 !! end
2388 !! article
2389 Template:Includes
2390 !! text
2391 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
2392 !! endarticle
2394 !! test
2395 <includeonly> and <noinclude> being included
2396 !! input
2397 {{Includes}}
2398 !! result
2399 <p>Foobar
2400 </p>
2401 !! end
2403 !! article
2404 Template:Includes2
2405 !! text
2406 <onlyinclude>Foo</onlyinclude>bar
2407 !! endarticle
2409 !! test
2410 <onlyinclude> being included
2411 !! input
2412 {{Includes2}}
2413 !! result
2414 <p>Foo
2415 </p>
2416 !! end
2419 !! article
2420 Template:Includes3
2421 !! text
2422 <onlyinclude>Foo</onlyinclude>bar<includeonly>zar</includeonly>
2423 !! endarticle
2425 !! test
2426 <onlyinclude> and <includeonly> being included
2427 !! input
2428 {{Includes3}}
2429 !! result
2430 <p>Foo
2431 </p>
2432 !! end
2434 !! test
2435 <includeonly> and <noinclude> on a page
2436 !! input
2437 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
2438 !! result
2439 <p>Foozar
2440 </p>
2441 !! end
2443 !! test
2444 <onlyinclude> on a page
2445 !! input
2446 <onlyinclude>Foo</onlyinclude>bar
2447 !! result
2448 <p>Foobar
2449 </p>
2450 !! end
2453 ### Pre-save transform tests
2455 !! test
2456 pre-save transform: subst:
2457 !! options
2459 !! input
2460 {{subst:test}}
2461 !! result
2462 This is a test template
2463 !! end
2465 !! test
2466 pre-save transform: normal template
2467 !! options
2469 !! input
2470 {{test}}
2471 !! result
2472 {{test}}
2473 !! end
2475 !! test
2476 pre-save transform: nonexistant template
2477 !! options
2479 !! input
2480 {{thistemplatedoesnotexist}}
2481 !! result
2482 {{thistemplatedoesnotexist}}
2483 !! end
2486 !! test
2487 pre-save transform: subst magic variables
2488 !! options
2490 !! input
2491 {{subst:SITENAME}}
2492 !! result
2493 MediaWiki
2494 !! end
2496 # This is bug 89, which I fixed. -- wtm
2497 !! test
2498 pre-save transform: subst: templates with parameters
2499 !! options
2501 !! input
2502 {{subst:paramtest|param="something else"}}
2503 !! result
2504 This is a test template with parameter "something else"
2505 !! end
2507 !! article
2508 Template:nowikitest
2509 !! text
2510 <nowiki>'''not wiki'''</nowiki>
2511 !! endarticle
2513 !! test
2514 pre-save transform: nowiki in subst (bug 1188)
2515 !! options
2517 !! input
2518 {{subst:nowikitest}}
2519 !! result
2520 <nowiki>'''not wiki'''</nowiki>
2521 !! end
2524 !! article
2525 Template:commenttest
2526 !! text
2527 This template has <!-- a comment --> in it.
2528 !! endarticle
2530 !! test
2531 pre-save transform: comment in subst (bug 1936)
2532 !! options
2534 !! input
2535 {{subst:commenttest}}
2536 !! result
2537 This template has <!-- a comment --> in it.
2538 !! end
2540 !! test
2541 pre-save transform: unclosed tag
2542 !! options
2543 pst noxml
2544 !! input
2545 <nowiki>'''not wiki'''
2546 !! result
2547 <nowiki>'''not wiki'''
2548 !! end
2550 !! test
2551 pre-save transform: mixed tag case
2552 !! options
2553 pst noxml
2554 !! input
2555 <NOwiki>'''not wiki'''</noWIKI>
2556 !! result
2557 <NOwiki>'''not wiki'''</noWIKI>
2558 !! end
2560 !! test
2561 pre-save transform: unclosed comment in <nowiki>
2562 !! options
2563 pst noxml
2564 !! input
2565 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
2566 !! result
2567 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
2568 !!end
2570 !! article
2571 Template:dangerous
2572 !!text
2573 <span onmouseover="alert('crap')">Oh no</span>
2574 !!endarticle
2576 !!test
2577 (confirming safety of fix for subst bug 1936)
2578 !! input
2579 {{Template:dangerous}}
2580 !! result
2581 <p><span>Oh no</span>
2582 </p>
2583 !! end
2585 !! test
2586 pre-save transform: comment containing gallery (bug 5024)
2587 !! options
2589 !! input
2590 <!-- <gallery>data</gallery> -->
2591 !!result
2592 <!-- <gallery>data</gallery> -->
2593 !!end
2595 !! test
2596 pre-save transform: comment containing extension
2597 !! options
2599 !! input
2600 <!-- <tag>data</tag> -->
2601 !!result
2602 <!-- <tag>data</tag> -->
2603 !!end
2605 !! test
2606 pre-save transform: comment containing nowiki
2607 !! options
2609 !! input
2610 <!-- <nowiki>data</nowiki> -->
2611 !!result
2612 <!-- <nowiki>data</nowiki> -->
2613 !!end
2615 !! test
2616 pre-save transform: comment containing math
2617 !! options
2619 !! input
2620 <!-- <math>data</math> -->
2621 !!result
2622 <!-- <math>data</math> -->
2623 !!end
2625 !! test
2626 pre-save transform: <noinclude> in subst (bug 3298)
2627 !! options
2629 !! input
2630 {{subst:Includes}}
2631 !! result
2632 Foobar
2633 !! end
2635 !! test
2636 pre-save transform: <onlyinclude> in subst (bug 3298)
2637 !! options
2639 !! input
2640 {{subst:Includes2}}
2641 !! result
2643 !! end
2645 !! test
2646 pre-save transform: context links ("pipe trick")
2647 !! options
2649 !! input
2650 [[Article (context)|]]
2651 [[Bar:Article|]]
2652 [[:Bar:Article|]]
2653 [[Bar:Article (context)|]]
2654 [[:Bar:Article (context)|]]
2655 [[|Article]]
2656 [[|Article (context)]]
2657 [[Bar:X (Y) Z|]]
2658 [[:Bar:X (Y) Z|]]
2659 !! result
2660 [[Article (context)|Article]]
2661 [[Bar:Article|Article]]
2662 [[:Bar:Article|Article]]
2663 [[Bar:Article (context)|Article]]
2664 [[:Bar:Article (context)|Article]]
2665 [[Article]]
2666 [[Article (context)]]
2667 [[Bar:X (Y) Z|X (Y) Z]]
2668 [[:Bar:X (Y) Z|X (Y) Z]]
2669 !! end
2671 !! test
2672 pre-save transform: context links ("pipe trick") with interwiki prefix
2673 !! options
2675 !! input
2676 [[interwiki:Article|]]
2677 [[:interwiki:Article|]]
2678 [[interwiki:Bar:Article|]]
2679 [[:interwiki:Bar:Article|]]
2680 !! result
2681 [[interwiki:Article|Article]]
2682 [[:interwiki:Article|Article]]
2683 [[interwiki:Bar:Article|Bar:Article]]
2684 [[:interwiki:Bar:Article|Bar:Article]]
2685 !! end
2687 !! test
2688 pre-save transform: context links ("pipe trick") with parens in title
2689 !! options
2690 pst title=[[Somearticle (context)]]
2691 !! input
2692 [[|Article]]
2693 !! result
2694 [[Article (context)|Article]]
2695 !! end
2697 !! test
2698 pre-save transform: context links ("pipe trick") with comma in title
2699 !! options
2700 pst title=[[Someplace, Somewhere]]
2701 !! input
2702 [[|Otherplace]]
2703 [[Otherplace, Elsewhere|]]
2704 [[Otherplace, Elsewhere, Anywhere|]]
2705 !! result
2706 [[Otherplace, Somewhere|Otherplace]]
2707 [[Otherplace, Elsewhere|Otherplace]]
2708 [[Otherplace, Elsewhere, Anywhere|Otherplace]]
2709 !! end
2711 !! test
2712 pre-save transform: context links ("pipe trick") with parens and comma
2713 !! options
2714 pst title=[[Someplace (IGNORED), Somewhere]]
2715 !! input
2716 [[|Otherplace]]
2717 [[Otherplace (place), Elsewhere|]]
2718 !! result
2719 [[Otherplace, Somewhere|Otherplace]]
2720 [[Otherplace (place), Elsewhere|Otherplace]]
2721 !! end
2723 !! test
2724 pre-save transform: context links ("pipe trick") with comma and parens
2725 !! options
2726 pst title=[[Who, me? (context)]]
2727 !! input
2728 [[|Yes, you.]]
2729 [[Me, Myself, and I (1937 song)|]]
2730 !! result
2731 [[Yes, you. (context)|Yes, you.]]
2732 [[Me, Myself, and I (1937 song)|Me, Myself, and I]]
2733 !! end
2735 !! test
2736 pre-save transform: context links ("pipe trick") with namespace
2737 !! options
2738 pst title=[[Ns:Somearticle]]
2739 !! input
2740 [[|Article]]
2741 !! result
2742 [[Ns:Article|Article]]
2743 !! end
2745 !! test
2746 pre-save transform: context links ("pipe trick") with namespace and parens
2747 !! options
2748 pst title=[[Ns:Somearticle (context)]]
2749 !! input
2750 [[|Article]]
2751 !! result
2752 [[Ns:Article (context)|Article]]
2753 !! end
2755 !! test
2756 pre-save transform: context links ("pipe trick") with namespace and comma
2757 !! options
2758 pst title=[[Ns:Somearticle, Context, Whatever]]
2759 !! input
2760 [[|Article]]
2761 !! result
2762 [[Ns:Article, Context, Whatever|Article]]
2763 !! end
2765 !! test
2766 pre-save transform: context links ("pipe trick") with namespace, comma and parens
2767 !! options
2768 pst title=[[Ns:Somearticle, Context (context)]]
2769 !! input
2770 [[|Article]]
2771 !! result
2772 [[Ns:Article (context)|Article]]
2773 !! end
2775 !! test
2776 pre-save transform: context links ("pipe trick") with namespace, parens and comma
2777 !! options
2778 pst title=[[Ns:Somearticle (IGNORED), Context]]
2779 !! input
2780 [[|Article]]
2781 !! result
2782 [[Ns:Article, Context|Article]]
2783 !! end
2787 ### Message transform tests
2789 !! test
2790 message transform: magic variables
2791 !! options
2793 !! input
2794 {{SITENAME}}
2795 !! result
2796 MediaWiki
2797 !! end
2799 !! test
2800 message transform: should not transform wiki markup
2801 !! options
2803 !! input
2804 ''test''
2805 !! result
2806 ''test''
2807 !! end
2809 !! test
2810 TODO: message transform: <noinclude> in transcluded template (bug 4926)
2811 !! options
2813 !! input
2814 {{Includes}}
2815 !! result
2816 Foobar
2817 !! end
2819 !! test
2820 TODO: message transform: <onlyinclude> in transcluded template (bug 4926)
2821 !! options
2823 !! input
2824 {{Includes2}}
2825 !! result
2827 !! end
2831 ### Images
2833 !! test
2834 Simple image
2835 !! input
2836 [[Image:foobar.jpg]]
2837 !! result
2838 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2839 </p>
2840 !! end
2842 !! test
2843 Right-aligned image
2844 !! input
2845 [[Image:foobar.jpg|right]]
2846 !! result
2847 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
2849 !! end
2851 !! test
2852 Image with caption
2853 !! input
2854 [[Image:foobar.jpg|right|Caption text]]
2855 !! result
2856 <div class="floatright"><span><a href="/wiki/Image:Foobar.jpg" class="image" title="Caption text"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Caption text" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
2858 !! end
2860 !! test
2861 Image with frame and link
2862 !! input
2863 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
2864 !! result
2865 <div class="thumb tleft"><div style="width:1943px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is a test image Main Page"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="This is a test image Main Page" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
2867 !! end
2869 !! test
2870 Link to image page- image page normally doesn't exists, hence edit link
2871 TODO: Add test with existing image page
2872 #<p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
2873 !! input
2874 [[:Image:test]]
2875 !! result
2876 <p><a href="/index.php?title=Image:Test&amp;action=edit" class="new" title="Image:Test">Image:test</a>
2877 </p>
2878 !! end
2880 !! test
2881 Frameless image caption with a free URL
2882 !! input
2883 [[Image:foobar.jpg|http://example.com]]
2884 !! result
2885 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="http://example.com"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="http://example.com" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2886 </p>
2887 !! end
2889 !! test
2890 Thumbnail image caption with a free URL
2891 !! input
2892 [[Image:foobar.jpg|thumb|http://example.com]]
2893 !! result
2894 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="http://example.com"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="http://example.com" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a></div></div></div>
2896 !! end
2898 !! test
2899 BUG 1887: A ISBN with a thumbnail
2900 !! input
2901 [[Image:foobar.jpg|thumb|ISBN 12354]]
2902 !! result
2903 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="ISBN 12354"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="ISBN 12354" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div><a href="/index.php?title=Special:Booksources&amp;isbn=12354" class="internal">ISBN 12354</a></div></div></div>
2905 !! end
2907 !! test
2908 BUG 1887: A RFC with a thumbnail
2909 !! input
2910 [[Image:foobar.jpg|thumb|This is RFC 12354]]
2911 !! result
2912 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is RFC 12354"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="This is RFC 12354" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This is <a href="http://www.ietf.org/rfc/rfc12354.txt" class="external" title="http://www.ietf.org/rfc/rfc12354.txt">RFC 12354</a></div></div></div>
2914 !! end
2916 !! test
2917 BUG 1887: A mailto link with a thumbnail
2918 !! input
2919 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
2920 !! result
2921 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Please mailto:nobody@example.com"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="Please mailto:nobody@example.com" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" title="mailto:nobody@example.com" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
2923 !! end
2925 !! test
2926 BUG 1887: A <math> with a thumbnail- we don't render math in the parsertests by default,
2927 so math is not stripped and turns up as escaped &lt;math&gt; tags.
2928 !! input
2929 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
2930 !! result
2931 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="&lt;math&gt;2+2&lt;/math&gt;"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="&lt;math&gt;2+2&lt;/math&gt;" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
2933 !! end
2935 !! test
2936 BUG 1887, part 2: A <math> with a thumbnail- math enabled
2937 !! options
2938 math
2939 !! input
2940 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
2941 !! result
2942 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="2 + 2"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="2 + 2" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div><span class="texhtml">2 + 2</span></div></div></div>
2944 !! end
2946 # Pending resolution to bug 368
2947 !! test
2948 BUG 648: Frameless image caption with a link
2949 !! input
2950 [[Image:foobar.jpg|text with a [[link]] in it]]
2951 !! result
2952 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2953 </p>
2954 !! end
2956 !! test
2957 BUG 648: Frameless image caption with a link (suffix)
2958 !! input
2959 [[Image:foobar.jpg|text with a [[link]]foo in it]]
2960 !! result
2961 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a linkfoo in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a linkfoo in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2962 </p>
2963 !! end
2965 !! test
2966 BUG 648: Frameless image caption with an interwiki link
2967 !! input
2968 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
2969 !! result
2970 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a MeatBall:Link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2971 </p>
2972 !! end
2974 !! test
2975 BUG 648: Frameless image caption with a piped interwiki link
2976 !! input
2977 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
2978 !! result
2979 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="text with a link in it"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="text with a link in it" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2980 </p>
2981 !! end
2983 !! test
2984 Escape HTML special chars in image alt text
2985 !! input
2986 [[Image:foobar.jpg|& < > "]]
2987 !! result
2988 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="&amp; &lt; &gt; &quot;"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="&amp; &lt; &gt; &quot;" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2989 </p>
2990 !! end
2992 !! test
2993 BUG 499: Alt text should have &#1234;, not &amp;1234;
2994 !! input
2995 [[Image:foobar.jpg|&#9792;]]
2996 !! result
2997 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="&#9792;"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="&#9792;" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
2998 </p>
2999 !! end
3001 !! test
3002 Broken image caption with link
3003 !! input
3004 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
3005 !! result
3006 <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.
3007 </p>
3008 !! end
3010 !! test
3011 Image caption containing another image
3012 !! input
3013 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
3014 !! result
3015 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This is a caption with another Image:Icon.png inside it!"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" alt="This is a caption with another Image:Icon.png inside it!" width="180" height="20" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This is a caption with another <a href="/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="Image:Icon.png">Image:Icon.png</a> inside it!</div></div></div>
3017 !! end
3019 !! test
3020 Image caption containing a newline
3021 !! input
3022 [[Image:Foobar.jpg|This
3023 *is some text]]
3024 !! result
3025 <p><a href="/wiki/Image:Foobar.jpg" class="image" title="This *is some text"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="This *is some text" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
3026 </p>
3027 !!end
3030 !! test
3031 Bug 3090: External links other than http: in image captions
3032 !! input
3033 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
3034 !! result
3035 <div class="thumb tright"><div style="width:202px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title="This caption has irc and Secure ext links in it."><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" alt="This caption has irc and Secure ext links in it." width="200" height="23" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div>This caption has <a href="irc://example.net" class="external text" title="irc://example.net" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" title="https://example.com" rel="nofollow">Secure</a> ext links in it.</div></div></div>
3037 !! end
3041 ### Subpages
3043 !! article
3044 Subpage test/subpage
3045 !! text
3047 !! endarticle
3049 !! test
3050 Subpage link
3051 !! options
3052 subpage title=[[Subpage test]]
3053 !! input
3054 [[/subpage]]
3055 !! result
3056 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
3057 </p>
3058 !! end
3060 !! test
3061 Subpage noslash link
3062 !! options
3063 subpage title=[[Subpage test]]
3064 !!input
3065 [[/subpage/]]
3066 !! result
3067 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
3068 </p>
3069 !! end
3071 !! test
3072 Disabled subpages
3073 !! input
3074 [[/subpage]]
3075 !! result
3076 <p><a href="/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
3077 </p>
3078 !! end
3080 !! test
3081 BUG 561: {{/Subpage}}
3082 !! options
3083 subpage title=[[Page]]
3084 !! input
3085 {{/Subpage}}
3086 !! result
3087 <p><a href="/index.php?title=Page/Subpage&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
3088 </p>
3089 !! end
3092 ### Categories
3094 !! article
3095 Category:MediaWiki User's Guide
3096 !! text
3097 blah
3098 !! endarticle
3100 !! test
3101 Link to category
3102 !! input
3103 [[:Category:MediaWiki User's Guide]]
3104 !! result
3105 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
3106 </p>
3107 !! end
3109 !! test
3110 Simple category
3111 !! options
3113 !! input
3114 [[Category:MediaWiki User's Guide]]
3115 !! result
3116 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
3117 !! end
3120 ### Inter-language links
3122 !! test
3123 Inter-language links
3124 !! options
3126 !! input
3127 [[es:Alimento]]
3128 [[fr:Nourriture]]
3129 [[zh:&#39135;&#21697;]]
3130 !! result
3131 es:Alimento fr:Nourriture zh:食品
3132 !! end
3135 ### Sections
3137 !! test
3138 Basic section headings
3139 !! input
3140 == Headline 1 ==
3141 Some text
3143 ==Headline 2==
3144 More
3145 ===Smaller headline===
3146 Blah blah
3147 !! result
3148 <a name="Headline_1"></a><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"> Headline 1 </span></h2>
3149 <p>Some text
3150 </p>
3151 <a name="Headline_2"></a><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">Headline 2</span></h2>
3152 <p>More
3153 </p>
3154 <a name="Smaller_headline"></a><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">Smaller headline</span></h3>
3155 <p>Blah blah
3156 </p>
3157 !! end
3159 !! test
3160 Section headings with TOC
3161 !! input
3162 == Headline 1 ==
3163 === Subheadline 1 ===
3164 ===== Skipping a level =====
3165 ====== Skipping a level ======
3167 == Headline 2 ==
3168 Some text
3169 ===Another headline===
3170 !! result
3171 <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
3172 <ul>
3173 <li class="toclevel-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
3174 <ul>
3175 <li class="toclevel-2"><a href="#Subheadline_1"><span class="tocnumber">1.1</span> <span class="toctext">Subheadline 1</span></a>
3176 <ul>
3177 <li class="toclevel-3"><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
3178 <ul>
3179 <li class="toclevel-4"><a href="#Skipping_a_level_2"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Skipping a level</span></a></li>
3180 </ul>
3181 </li>
3182 </ul>
3183 </li>
3184 </ul>
3185 </li>
3186 <li class="toclevel-1"><a href="#Headline_2"><span class="tocnumber">2</span> <span class="toctext">Headline 2</span></a>
3187 <ul>
3188 <li class="toclevel-2"><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
3189 </ul>
3190 </li>
3191 </ul>
3192 </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3193 <a name="Headline_1"></a><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"> Headline 1 </span></h2>
3194 <a name="Subheadline_1"></a><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"> Subheadline 1 </span></h3>
3195 <a name="Skipping_a_level"></a><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"> Skipping a level </span></h5>
3196 <a name="Skipping_a_level_2"></a><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"> Skipping a level </span></h6>
3197 <a name="Headline_2"></a><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"> Headline 2 </span></h2>
3198 <p>Some text
3199 </p>
3200 <a name="Another_headline"></a><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">Another headline</span></h3>
3202 !! end
3204 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
3205 !! test
3206 Handling of sections up to level 6 and beyond
3207 !! input 
3208 = Level 1 Heading=
3209 == Level 2 Heading==
3210 === Level 3 Heading===
3211 ==== Level 4 Heading====
3212 ===== Level 5 Heading=====
3213 ====== Level 6 Heading======
3214 ======= Level 7 Heading=======
3215 ======== Level 8 Heading========
3216 ========= Level 9 Heading=========
3217 ========== Level 10 Heading==========
3218 !! result
3219 <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
3220 <ul>
3221 <li class="toclevel-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
3222 <ul>
3223 <li class="toclevel-2"><a href="#Level_2_Heading"><span class="tocnumber">1.1</span> <span class="toctext">Level 2 Heading</span></a>
3224 <ul>
3225 <li class="toclevel-3"><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
3226 <ul>
3227 <li class="toclevel-4"><a href="#Level_4_Heading"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Level 4 Heading</span></a>
3228 <ul>
3229 <li class="toclevel-5"><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
3230 <ul>
3231 <li class="toclevel-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>
3232 <li class="toclevel-6"><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>
3233 <li class="toclevel-6"><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>
3234 <li class="toclevel-6"><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>
3235 <li class="toclevel-6"><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>
3236 </ul>
3237 </li>
3238 </ul>
3239 </li>
3240 </ul>
3241 </li>
3242 </ul>
3243 </li>
3244 </ul>
3245 </li>
3246 </ul>
3247 </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3248 <a name="Level_1_Heading"></a><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"> Level 1 Heading</span></h1>
3249 <a name="Level_2_Heading"></a><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"> Level 2 Heading</span></h2>
3250 <a name="Level_3_Heading"></a><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"> Level 3 Heading</span></h3>
3251 <a name="Level_4_Heading"></a><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"> Level 4 Heading</span></h4>
3252 <a name="Level_5_Heading"></a><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"> Level 5 Heading</span></h5>
3253 <a name="Level_6_Heading"></a><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"> Level 6 Heading</span></h6>
3254 <a name=".3D_Level_7_Heading.3D"></a><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">= Level 7 Heading=</span></h6>
3255 <a name=".3D.3D_Level_8_Heading.3D.3D"></a><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">== Level 8 Heading==</span></h6>
3256 <a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><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">=== Level 9 Heading===</span></h6>
3257 <a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><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">==== Level 10 Heading====</span></h6>
3259 !! end
3261 !! test
3262 Resolving duplicate section names
3263 !! input
3264 == Foo bar ==
3265 == Foo bar ==
3266 !! result
3267 <a name="Foo_bar"></a><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"> Foo bar </span></h2>
3268 <a name="Foo_bar_2"></a><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"> Foo bar </span></h2>
3270 !! end
3272 !! article
3273 Template:sections
3274 !! text
3275 ===Section 1===
3276 ==Section 2==
3277 !! endarticle
3279 !! test
3280 Template with sections, __NOTOC__
3281 !! input
3282 __NOTOC__
3283 ==Section 0==
3284 {{sections}}
3285 ==Section 4==
3286 !! result
3287 <a name="Section_0"></a><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">Section 0</span></h2>
3288 <a name="Section_1"></a><h3><span class="editsection">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 1</span></h3>
3289 <a name="Section_2"></a><h2><span class="editsection">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 2</span></h2>
3290 <a name="Section_4"></a><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">Section 4</span></h2>
3292 !! end
3294 !! test
3295 __NOEDITSECTION__ keyword
3296 !! input
3297 __NOEDITSECTION__
3298 ==Section 1==
3299 ==Section 2==
3300 !! result
3301 <a name="Section_1"></a><h2> <span class="mw-headline">Section 1</span></h2>
3302 <a name="Section_2"></a><h2> <span class="mw-headline">Section 2</span></h2>
3304 !! end
3306 !! test
3307 Link inside a section heading
3308 !! input
3309 ==Section with a [[Main Page|link]] in it==
3310 !! result
3311 <a name="Section_with_a_link_in_it"></a><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">Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</span></h2>
3313 !! end
3316 !! test
3317 BUG 1219 URL next to image (good)
3318 !! input
3319 http://example.com [[Image:foobar.jpg]]
3320 !! result
3321 <p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> <a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
3322 </p>
3323 !!end
3325 !! test
3326 BUG 1219 URL next to image (broken)
3327 !! input
3328 http://example.com[[Image:foobar.jpg]]
3329 !! result
3330 <p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><a href="/wiki/Image:Foobar.jpg" class="image" title="Image:foobar.jpg"><img src="http://example.com/images/3/3a/Foobar.jpg" alt="Image:foobar.jpg" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a>
3331 </p>
3332 !!end
3334 !! test
3335 Bug 1186 news: in the middle of text
3336 !! input
3337 http://en.wikinews.org/wiki/Wikinews:Workplace
3338 !! result
3339 <p><a href="http://en.wikinews.org/wiki/Wikinews:Workplace" class="external free" title="http://en.wikinews.org/wiki/Wikinews:Workplace" rel="nofollow">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
3340 </p>
3341 !!end
3344 !! test
3345 Namespaced link must have a title
3346 !! input
3347 [[Project:]]
3348 !! result
3349 <p>[[Project:]]
3350 </p>
3351 !!end
3353 !! test
3354 Namespaced link must have a title (bad fragment version)
3355 !! input
3356 [[Project:#fragment]]
3357 !! result
3358 <p>[[Project:#fragment]]
3359 </p>
3360 !!end
3363 !! test
3364 div with no attributes
3365 !! input
3366 <div>HTML rocks</div>
3367 !! result
3368 <div>HTML rocks</div>
3370 !! end
3372 !! test
3373 div with double-quoted attribute
3374 !! input
3375 <div id="rock">HTML rocks</div>
3376 !! result
3377 <div id="rock">HTML rocks</div>
3379 !! end
3381 !! test
3382 div with single-quoted attribute
3383 !! input
3384 <div id='rock'>HTML rocks</div>
3385 !! result
3386 <div id="rock">HTML rocks</div>
3388 !! end
3390 !! test
3391 div with unquoted attribute
3392 !! input
3393 <div id=rock>HTML rocks</div>
3394 !! result
3395 <div id="rock">HTML rocks</div>
3397 !! end
3399 !! test
3400 div with illegal double attributes
3401 !! input
3402 <div align="center" align="right">HTML rocks</div>
3403 !! result
3404 <div align="right">HTML rocks</div>
3406 !!end
3408 !! test
3409 HTML multiple attributes correction
3410 !! input
3411 <p class="error" class="awesome">Awesome!</p>
3412 !! result
3413 <p class="awesome">Awesome!</p>
3415 !!end
3417 !! test
3418 Table multiple attributes correction
3419 !! input
3421 !+ class="error" class="awesome"| status
3423 !! result
3424 <table>
3425 <tr>
3426 <th class="awesome"> status
3427 </th></tr></table>
3429 !!end
3431 !! test
3432 DIV IN UPPERCASE
3433 !! input
3434 <DIV ALIGN="center">HTML ROCKS</DIV>
3435 !! result
3436 <div align="center">HTML ROCKS</div>
3438 !!end
3441 !! test
3442 text with amp in the middle of nowhere
3443 !! input
3444 Remember AT&T?
3445 !!result
3446 <p>Remember AT&amp;T?
3447 </p>
3448 !! end
3450 !! test
3451 text with character entity: eacute
3452 !! input
3453 I always thought &eacute; was a cute letter.
3454 !! result
3455 <p>I always thought &eacute; was a cute letter.
3456 </p>
3457 !! end
3459 !! test
3460 text with undefined character entity: xacute
3461 !! input
3462 I always thought &xacute; was a cute letter.
3463 !! result
3464 <p>I always thought &amp;xacute; was a cute letter.
3465 </p>
3466 !! end
3470 ### Media links
3473 !! test
3474 Media link
3475 !! input
3476 [[Media:Foobar.jpg]]
3477 !! result
3478 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Media:Foobar.jpg</a>
3479 </p>
3480 !! end
3482 !! test
3483 Media link with text
3484 !! input
3485 [[Media:Foobar.jpg|A neat file to look at]]
3486 !! result
3487 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">A neat file to look at</a>
3488 </p>
3489 !! end
3491 # FIXME: this is still bad HTML tag nesting
3492 !! test
3493 Media link with nasty text
3494 fixme: doBlockLevels won't wrap this in a paragraph because it contains a div
3495 !! input
3496 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
3497 !! result
3498 <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>
3500 !! end
3502 !! test
3503 Media link to nonexistent file (bug 1702)
3504 !! input
3505 [[Media:No such.jpg]]
3506 !! result
3507 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
3508 </p>
3509 !! end
3511 !! test
3512 Image link to nonexistent file (bug 1850 - good)
3513 !! input
3514 [[Image:No such.jpg]]
3515 !! result
3516 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="Image:No such.jpg">Image:No such.jpg</a>
3517 </p>
3518 !! end
3520 !! test
3521 :Image link to nonexistent file (bug 1850 - bad)
3522 !! input
3523 [[:Image:No such.jpg]]
3524 !! result
3525 <p><a href="/index.php?title=Image:No_such.jpg&amp;action=edit" class="new" title="Image:No such.jpg">Image:No such.jpg</a>
3526 </p>
3527 !! end
3531 !! test
3532 Character reference normalization in link text (bug 1938)
3533 !! input
3534 [[Main Page|this&that]]
3535 !! result
3536 <p><a href="/wiki/Main_Page" title="Main Page">this&amp;that</a>
3537 </p>
3538 !!end
3540 !! test
3541 Empty attribute crash test (bug 2067)
3542 !! input
3543 <font color="">foo</font>
3544 !! result
3545 <p><font color="">foo</font>
3546 </p>
3547 !! end
3549 !! test
3550 Empty attribute crash test single-quotes (bug 2067)
3551 !! input
3552 <font color=''>foo</font>
3553 !! result
3554 <p><font color="">foo</font>
3555 </p>
3556 !! end
3558 !! test
3559 Attribute test: equals, then nothing
3560 !! input
3561 <font color=>foo</font>
3562 !! result
3563 <p><font>foo</font>
3564 </p>
3565 !! end
3567 !! test
3568 Attribute test: unquoted value
3569 !! input
3570 <font color=x>foo</font>
3571 !! result
3572 <p><font color="x">foo</font>
3573 </p>
3574 !! end
3576 !! test
3577 Attribute test: unquoted but illegal value (hash)
3578 !! input
3579 <font color=#x>foo</font>
3580 !! result
3581 <p><font color="#x">foo</font>
3582 </p>
3583 !! end
3585 !! test
3586 Attribute test: no value
3587 !! input
3588 <font color>foo</font>
3589 !! result
3590 <p><font color="color">foo</font>
3591 </p>
3592 !! end
3594 !! test
3595 Bug 2095: link with three closing brackets
3596 !! input
3597 [[Main Page]]]
3598 !! result
3599 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
3600 </p>
3601 !! end
3603 !! test
3604 Bug 2095: link with pipe and three closing brackets
3605 !! input
3606 [[Main Page|link]]]
3607 !! result
3608 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
3609 </p>
3610 !! end
3612 !! test
3613 Bug 2095: link with pipe and three closing brackets, version 2
3614 !! input
3615 [[Main Page|[http://example.com/]]]
3616 !! result
3617 <p><a href="/wiki/Main_Page" title="Main Page">[http://example.com/]</a>
3618 </p>
3619 !! end
3623 ### Safety
3626 !! article
3627 Template:Dangerous attribute
3628 !! text
3629 " onmouseover="alert(document.cookie)
3630 !! endarticle
3632 !! article
3633 Template:Dangerous style attribute
3634 !! text
3635 border-size: expression(alert(document.cookie))
3636 !! endarticle
3638 !! article
3639 Template:Div style
3640 !! text
3641 <div style="float: right; {{{1}}}">Magic div</div>
3642 !! endarticle
3644 !! test
3645 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
3646 !! input
3647 <div title="{{test}}"></div>
3648 !! result
3649 <div title="This is a test template"></div>
3651 !! end
3653 !! test
3654 Bug 2304: HTML attribute safety (dangerous template; 2309)
3655 !! input
3656 <div title="{{dangerous attribute}}"></div>
3657 !! result
3658 <div title=""></div>
3660 !! end
3662 !! test
3663 Bug 2304: HTML attribute safety (dangerous style template; 2309)
3664 !! input
3665 <div style="{{dangerous style attribute}}"></div>
3666 !! result
3667 <div></div>
3669 !! end
3671 !! test
3672 Bug 2304: HTML attribute safety (safe parameter; 2309)
3673 !! input
3674 {{div style|width: 200px}}
3675 !! result
3676 <div style="float: right; width: 200px">Magic div</div>
3678 !! end
3680 !! test
3681 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
3682 !! input
3683 {{div style|width: expression(alert(document.cookie))}}
3684 !! result
3685 <div>Magic div</div>
3687 !! end
3689 !! test
3690 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
3691 !! input
3692 {{div style|"><script>alert(document.cookie)</script>}}
3693 !! result
3694 <div>Magic div</div>
3696 !! end
3698 !! test
3699 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
3700 !! input
3701 {{div style|" ><script>alert(document.cookie)</script>}}
3702 !! result
3703 <div style="float: right;">Magic div</div>
3705 !! end
3707 !! test
3708 Bug 2304: HTML attribute safety (link)
3709 !! input
3710 <div title="[[Main Page]]"></div>
3711 !! result
3712 <div title="&#91;&#91;Main Page]]"></div>
3714 !! end
3716 !! test
3717 Bug 2304: HTML attribute safety (italics)
3718 !! input
3719 <div title="''foobar''"></div>
3720 !! result
3721 <div title="&#39;&#39;foobar&#39;&#39;"></div>
3723 !! end
3725 !! test
3726 Bug 2304: HTML attribute safety (bold)
3727 !! input
3728 <div title="'''foobar'''"></div>
3729 !! result
3730 <div title="&#39;&#39;'foobar&#39;&#39;'"></div>
3732 !! end
3735 !! test
3736 Bug 2304: HTML attribute safety (ISBN)
3737 !! input
3738 <div title="ISBN 1234567890"></div>
3739 !! result
3740 <div title="&#73;SBN 1234567890"></div>
3742 !! end
3744 !! test
3745 Bug 2304: HTML attribute safety (RFC)
3746 !! input
3747 <div title="RFC 1234"></div>
3748 !! result
3749 <div title="&#82;FC 1234"></div>
3751 !! end
3753 !! test
3754 Bug 2304: HTML attribute safety (PMID)
3755 !! input
3756 <div title="PMID 1234567890"></div>
3757 !! result
3758 <div title="&#80;MID 1234567890"></div>
3760 !! end
3762 !! test
3763 Bug 2304: HTML attribute safety (web link)
3764 !! input
3765 <div title="http://example.com/"></div>
3766 !! result
3767 <div title="http&#58;//example.com/"></div>
3769 !! end
3771 !! test
3772 Bug 2304: HTML attribute safety (named web link)
3773 !! input
3774 <div title="[http://example.com/ link]"></div>
3775 !! result
3776 <div title="&#91;http&#58;//example.com/ link]"></div>
3778 !! end
3780 !! test
3781 Bug 3244: HTML attribute safety (extension; safe)
3782 !! input
3783 <div style="<nowiki>background:blue</nowiki>"></div>
3784 !! result
3785 <div style="background:blue"></div>
3787 !! end
3789 !! test
3790 Bug 3244: HTML attribute safety (extension; unsafe)
3791 !! input
3792 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
3793 !! result
3794 <div></div>
3796 !! end
3798 !! test
3799 Math section safety when disabled
3800 !! input
3801 <math><script>alert(document.cookies);</script></math>
3802 !! result
3803 <p>&lt;math&gt;&lt;script&gt;alert(document.cookies);&lt;/script&gt;&lt;/math&gt;
3804 </p>
3805 !! end
3807 # More MSIE fun discovered by Tom Gilder
3809 !! test
3810 MSIE CSS safety test: spurious slash
3811 !! input
3812 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
3813 !! result
3814 <div>evil</div>
3816 !! end
3818 !! test
3819 MSIE CSS safety test: hex code
3820 !! input
3821 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
3822 !! result
3823 <div>evil</div>
3825 !! end
3827 !! test
3828 MSIE CSS safety test: comment in url
3829 !! input
3830 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
3831 !! result
3832 <div style="background-image:u rl(javascript:alert('boo'))">evil</div>
3834 !! end
3836 !! test
3837 MSIE CSS safety test: comment in expression
3838 !! input
3839 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
3840 !! result
3841 <div style="background-image:expres sion(alert('boo4'))">evil4</div>
3843 !! end
3846 !! test
3847 Table attribute legitimate extension
3848 !! input
3850 !+ style="<nowiki>color:blue</nowiki>"| status
3852 !! result
3853 <table>
3854 <tr>
3855 <th style="color:blue"> status
3856 </th></tr></table>
3858 !!end
3860 !! test
3861 Table attribute safety
3862 !! input
3864 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
3866 !! result
3867 <table>
3868 <tr>
3869 <th> status
3870 </th></tr></table>
3872 !! end
3875 !! article
3876 Template:Identity
3877 !! text
3878 {{{1}}}
3879 !! endarticle
3881 !! test
3882 Expansion of multi-line templates in attribute values (bug 6255)
3883 !! input
3884 <div style="background: {{identity|#00FF00}}">-</div>
3885 !! result
3886 <div style="background: #00FF00">-</div>
3888 !! end
3891 !! test
3892 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
3893 !! input
3894 <div style="background: 
3895 #00FF00">-</div>
3896 !! result
3897 <div style="background: #00FF00">-</div>
3899 !! end
3901 !! test
3902 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
3903 !! input
3904 <div style="background: &#10;#00FF00">-</div>
3905 !! result
3906 <div style="background: &#10;#00FF00">-</div>
3908 !! end
3911 ### Parser hooks (see maintenance/parserTestsParserHook.php for the <tag> extension)
3913 !! test
3914 Parser hook: empty input
3915 !! input
3916 <tag></tag>
3917 !! result
3918 <pre>
3919 string(0) ""
3920 array(0) {
3922 </pre>
3924 !! end
3926 !! test
3927 Parser hook: empty input using terminated empty elements
3928 !! input
3929 <tag/>
3930 !! result
3931 <pre>
3932 NULL
3933 array(0) {
3935 </pre>
3937 !! end
3939 !! test
3940 Parser hook: empty input using terminated empty elements (space before)
3941 !! input
3942 <tag />
3943 !! result
3944 <pre>
3945 NULL
3946 array(0) {
3948 </pre>
3950 !! end
3952 !! test
3953 Parser hook: basic input
3954 !! input
3955 <tag>input</tag>
3956 !! result
3957 <pre>
3958 string(5) "input"
3959 array(0) {
3961 </pre>
3963 !! end
3966 !! test
3967 Parser hook: case insensetive
3968 !! input
3969 <TAG>input</TAG>
3970 !! result
3971 <pre>
3972 string(5) "input"
3973 array(0) {
3975 </pre>
3977 !! end
3980 !! test
3981 Parser hook: case insensetive, redux
3982 !! input
3983 <TaG>input</TAg>
3984 !! result
3985 <pre>
3986 string(5) "input"
3987 array(0) {
3989 </pre>
3991 !! end
3993 !! test
3994 Parser hook: nested tags
3995 !! options
3996 noxml
3997 !! input
3998 <tag><tag></tag></tag>
3999 !! result
4000 <pre>
4001 string(5) "<tag>"
4002 array(0) {
4004 </pre>&lt;/tag&gt;
4006 !! end
4008 !! test
4009 Parser hook: basic arguments
4010 !! input
4011 <tag width=200 height = "100" depth = '50' square></tag>
4012 !! result
4013 <pre>
4014 string(0) ""
4015 array(4) {
4016   ["width"]=>
4017   string(3) "200"
4018   ["height"]=>
4019   string(3) "100"
4020   ["depth"]=>
4021   string(2) "50"
4022   ["square"]=>
4023   string(6) "square"
4025 </pre>
4027 !! end
4029 !! test
4030 Parser hook: argument containing a forward slash (bug 5344)
4031 !! input
4032 <tag filename='/tmp/bla'></tag>
4033 !! result
4034 <pre>
4035 string(0) ""
4036 array(1) {
4037   ["filename"]=>
4038   string(8) "/tmp/bla"
4040 </pre>
4042 !! end
4044 !! test
4045 Parser hook: empty input using terminated empty elements (bug 2374)
4046 !! input
4047 <tag foo=bar/>text
4048 !! result
4049 <pre>
4050 NULL
4051 array(1) {
4052   ["foo"]=>
4053   string(3) "bar"
4055 </pre>text
4057 !! end
4059 # </tag> should be output literally since there is no matching tag that begins it
4060 !! test
4061 Parser hook: basic arguments using terminated empty elements (bug 2374)
4062 !! input
4063 <tag width=200 height = "100" depth = '50' square/>
4064 other stuff
4065 </tag>
4066 !! result
4067 <pre>
4068 NULL
4069 array(4) {
4070   ["width"]=>
4071   string(3) "200"
4072   ["height"]=>
4073   string(3) "100"
4074   ["depth"]=>
4075   string(2) "50"
4076   ["square"]=>
4077   string(6) "square"
4079 </pre>
4080 <p>other stuff
4081 &lt;/tag&gt;
4082 </p>
4083 !! end
4086 ### (see maintenance/parserTestsStaticParserHook.php for the <statictag> extension)
4089 !! test
4090 Parser hook: static parser hook not inside a comment
4091 !! input
4092 <statictag>hello, world</statictag>
4093 <statictag action=flush/>
4094 !! result
4095 <p>hello, world
4096 </p>
4097 !! end
4100 !! test
4101 Parser hook: static parser hook inside a comment
4102 !! input
4103 <!-- <statictag>hello, world</statictag> -->
4104 <statictag action=flush/>
4105 !! result
4106 <p><br />
4107 </p>
4108 !! end
4110 # Nested template calls; this case was broken by Parser.php rev 1.506,
4111 # since reverted.
4113 !! article
4114 Template:One-parameter
4115 !! text
4116 (My parameter is: {{{1}}})
4117 !! endarticle
4119 !! article
4120 Template:Map-one-parameter
4121 !! text
4122 {{{{{1}}}|{{{2}}}}}
4123 !! endarticle
4125 !! test
4126 Nested template calls
4127 !! input
4128 {{Map-one-parameter|One-parameter|param}}
4129 !! result
4130 <p>(My parameter is: param)
4131 </p>
4132 !! end
4136 ### Sanitizer
4138 !! test
4139 Sanitizer: Closing of open tags
4140 !! input
4141 <s></s><table></table>
4142 !! result
4143 <s></s><table></table>
4145 !! end
4147 !! test
4148 Sanitizer: Closing of open but not closed tags
4149 !! input
4150 <s>foo
4151 !! result
4152 <p><s>foo</s>
4153 </p>
4154 !! end
4156 !! test
4157 Sanitizer: Closing of closed but not open tags
4158 !! input
4159 </s>
4160 !! result
4161 <p>&lt;/s&gt;
4162 </p>
4163 !! end
4165 !! test
4166 Sanitizer: Closing of closed but not open table tags
4167 !! input
4168 Table not started</td></tr></table>
4169 !! result
4170 <p>Table not started&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
4171 </p>
4172 !! end
4174 !! test
4175 Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
4176 !! input
4177 <span id="æ: v">byte</span>[[#æ: v|backlink]]
4178 !! result
4179 <p><span id=".C3.A6:_v">byte</span><a href="#.C3.A6:_v" title="">backlink</a>
4180 </p>
4181 !! end
4183 !! test
4184 Sanitizer: Validating the contents of the id attribute (bug 4515)
4185 !! options
4186 disabled
4187 !! input
4188 <br id=9 />
4189 !! result
4190 Something, but defenetly not <br id="9" />...
4191 !! end
4193 !! test
4194 Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301)
4195 !! options
4196 disabled
4197 !! input
4198 <br id="foo" /><br id="foo" />
4199 !! result
4200 Something need to be done. foo-2 ? 
4201 !! end
4203 !! test
4204 Language converter: output gets cut off unexpectedly (bug 5757)
4205 !! options
4206 language=zh
4207 !! input
4208 this bit is safe: }-
4210 but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
4212 then we get cut off here: }-
4214 all additional text is vanished
4215 !! result
4216 <p>this bit is safe: }-
4217 </p><p>but if we add a conversion instance: xxx
4218 </p><p>then we get cut off here: }-
4219 </p><p>all additional text is vanished
4220 </p>
4221 !! end
4223 !! test
4224 Self closed html pairs (bug 5487)
4225 !! options
4226 !! input
4227 <center><font id="bug" />Centered text</center>
4228 <div><font id="bug2" />In div text</div>
4229 !! result
4230 <center>&lt;font id="bug" /&gt;Centered text</center>
4231 <div>&lt;font id="bug2" /&gt;In div text</div>
4233 !! end
4239 !! test
4240 HTML bullet list, closed tags (bug 5497)
4241 !! input
4242 <ul>
4243 <li>One</li>
4244 <li>Two</li>
4245 </ul>
4246 !! result
4247 <ul>
4248 <li>One</li>
4249 <li>Two</li>
4250 </ul>
4252 !! end
4254 !! test
4255 TODO: HTML bullet list, unclosed tags (bug 5497)
4256 !! input
4257 <ul>
4258 <li>One
4259 <li>Two
4260 </ul>
4261 !! result
4262 <ul>
4263 <li>One
4264 </li><li>Two
4265 </li></ul>
4267 !! end
4269 !! test
4270 HTML ordered list, closed tags (bug 5497)
4271 !! input
4272 <ol>
4273 <li>One</li>
4274 <li>Two</li>
4275 </ol>
4276 !! result
4277 <ol>
4278 <li>One</li>
4279 <li>Two</li>
4280 </ol>
4282 !! end
4284 !! test
4285 TODO: HTML ordered list, unclosed tags (bug 5497)
4286 !! input
4287 <ol>
4288 <li>One
4289 <li>Two
4290 </ol>
4291 !! result
4292 <ol>
4293 <li>One
4294 </li><li>Two
4295 </li></ol>
4297 !! end
4299 !! test
4300 HTML nested bullet list, closed tags (bug 5497)
4301 !! input
4302 <ul>
4303 <li>One</li>
4304 <li>Two:
4305 <ul>
4306 <li>Sub-one</li>
4307 <li>Sub-two</li>
4308 </ul>
4309 </li>
4310 </ul>
4311 !! result
4312 <ul>
4313 <li>One</li>
4314 <li>Two:
4315 <ul>
4316 <li>Sub-one</li>
4317 <li>Sub-two</li>
4318 </ul>
4319 </li>
4320 </ul>
4322 !! end
4324 !! test
4325 TODO: HTML nested bullet list, open tags (bug 5497)
4326 !! input
4327 <ul>
4328 <li>One
4329 <li>Two:
4330 <ul>
4331 <li>Sub-one
4332 <li>Sub-two
4333 </ul>
4334 </ul>
4335 !! result
4336 <ul>
4337 <li>One
4338 </li><li>Two:
4339 <ul>
4340 <li>Sub-one
4341 </li><li>Sub-two
4342 </li></ul>
4343 </li></ul>
4345 !! end
4347 !! test
4348 HTML nested ordered list, closed tags (bug 5497)
4349 !! input
4350 <ol>
4351 <li>One</li>
4352 <li>Two:
4353 <ol>
4354 <li>Sub-one</li>
4355 <li>Sub-two</li>
4356 </ol>
4357 </li>
4358 </ol>
4359 !! result
4360 <ol>
4361 <li>One</li>
4362 <li>Two:
4363 <ol>
4364 <li>Sub-one</li>
4365 <li>Sub-two</li>
4366 </ol>
4367 </li>
4368 </ol>
4370 !! end
4372 !! test
4373 TODO: HTML nested ordered list, open tags (bug 5497)
4374 !! input
4375 <ol>
4376 <li>One
4377 <li>Two:
4378 <ol>
4379 <li>Sub-one
4380 <li>Sub-two
4381 </ol>
4382 </ol>
4383 !! result
4384 <ol>
4385 <li>One
4386 </li><li>Two:
4387 <ol>
4388 <li>Sub-one
4389 </li><li>Sub-two
4390 </li></ol>
4391 </li></ol>
4393 !! end
4395 !! test
4396 HTML ordered list item with parameters oddity
4397 !! input
4398 <ol><li id="fragment">One</li></ol>
4399 !! result
4400 <ol><li id="fragment">One</li></ol>
4402 !! end
4404 !!test
4405 bug 5918: autonumbering
4406 !! input
4407 [http://first/] [http://second] [ftp://ftp]
4409 ftp://inlineftp
4411 [mailto:enclosed@mail.tld With target]
4413 [mailto:enclosed@mail.tld]
4415 mailto:inline@mail.tld
4416 !! result
4417 <p><a href="http://first/" class="external autonumber" title="http://first/" rel="nofollow">[1]</a> <a href="http://second" class="external autonumber" title="http://second" rel="nofollow">[2]</a> <a href="ftp://ftp" class="external autonumber" title="ftp://ftp" rel="nofollow">[3]</a>
4418 </p><p><a href="ftp://inlineftp" class="external free" title="ftp://inlineftp" rel="nofollow">ftp://inlineftp</a>
4419 </p><p><a href="mailto:enclosed@mail.tld" class="external text" title="mailto:enclosed@mail.tld" rel="nofollow">With target</a>
4420 </p><p><a href="mailto:enclosed@mail.tld" class="external autonumber" title="mailto:enclosed@mail.tld" rel="nofollow">[4]</a>
4421 </p><p><a href="mailto:inline@mail.tld" class="external free" title="mailto:inline@mail.tld" rel="nofollow">mailto:inline@mail.tld</a>
4422 </p>
4423 !! end
4427 # Security and HTML correctness
4428 # From Nick Jenkins' fuzz testing
4431 !! test
4432 Fuzz testing: Parser13
4433 !! input
4434 {| 
4435 | http://a|
4436 !! result
4437 <table>
4438 <tr>
4439 <td>
4440 </td>
4441 </tr>
4442 </table>
4444 !! end
4446 !! test
4447 Fuzz testing: Parser14
4448 !! input
4449 == onmouseover= ==
4450 http://__TOC__
4451 !! result
4452 <a name="onmouseover.3D"></a><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"> onmouseover= </span></h2>
4453 http://<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
4454 <ul>
4455 <li class="toclevel-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
4456 </ul>
4457 </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
4459 !! end
4461 !! test
4462 Fuzz testing: Parser14-table
4463 !! input
4464 ==a==
4465 {| STYLE=__TOC__
4466 !! result
4467 <a name="a"></a><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">a</span></h2>
4468 <table style="&#95;_TOC&#95;_">
4469 <tr><td></td></tr>
4470 </table>
4472 !! end
4474 # Known to produce bogus xml (extra </td>)
4475 !! test
4476 Fuzz testing: Parser16
4477 !! options
4478 noxml
4479 !! input
4481 !https://||||||
4482 !! result
4483 <table>
4484 <tr>
4485 <th>https://</th><th></th><th></th><th>
4486 </td>
4487 </tr>
4488 </table>
4490 !! end
4492 !! test
4493 Fuzz testing: Parser21
4494 !! input
4496 ! irc://{{ftp://a" onmouseover="alert('hello world');"
4498 !! result
4499 <table>
4500 <tr>
4501 <th> <a href="irc://{{ftp://a" class="external free" title="irc://{{ftp://a" rel="nofollow">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
4502 </th><td>
4503 </td>
4504 </tr>
4505 </table>
4507 !! end
4509 !! test
4510 Fuzz testing: Parser22
4511 !! input
4512 http://===r:::https://b
4515 !!result
4516 <p><a href="http://===r:::https://b" class="external free" title="http://===r:::https://b" rel="nofollow">http://===r:::https://b</a>
4517 </p>
4518 <table>
4519 <tr><td></td></tr>
4520 </table>
4522 !! end
4524 # Known to produce bad XML for now
4525 !! test
4526 Fuzz testing: Parser24
4527 !! options
4528 noxml
4529 !! input
4531 {{{|
4532 <u CLASS=
4533 | {{{{SSSll!!!!!!!VVVV)]]][[Special:*xxxxxxx--><noinclude>}}}} >
4534 <br style="onmouseover='alert(document.cookie);' " />
4536 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
4538 !! result
4539 <table>
4541 <u class="&#124;">} &gt;
4542 <br style="onmouseover='alert(document.cookie);'" />
4544 MOVE YOUR MOUSE CURSOR OVER THIS TEXT
4545 <tr>
4546 <td></u>
4547 </td>
4548 </tr>
4549 </table>
4551 !! end
4553 # Known to produce bad XML for now
4554 !!test
4555 Fuzz testing: Parser25 (bug 6055)
4556 !! options
4557 noxml
4558 !! input
4561 <LI CLASS=||
4563 }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE
4564 !! result
4565 <li class="&#124;&#124;">
4566 blah" onmouseover="alert('hello world');" align="left"<b>MOVE MOUSE CURSOR OVER HERE</b>
4568 !! end
4570 !!test
4571 Fuzz testing: URL adjacent extension (with space, clean)
4572 !! options
4573 !! input
4574 http://example.com <nowiki>junk</nowiki>
4575 !! result
4576 <p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a> junk
4577 </p>
4578 !!end
4580 !!test
4581 Fuzz testing: URL adjacent extension (no space, dirty; nowiki)
4582 !! options
4583 !! input
4584 http://example.com<nowiki>junk</nowiki>
4585 !! result
4586 <p><a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a>junk
4587 </p>
4588 !!end
4590 !!test
4591 Fuzz testing: URL adjacent extension (no space, dirty; pre)
4592 !! options
4593 !! input
4594 http://example.com<pre>junk</pre>
4595 !! result
4596 <a href="http://example.com" class="external free" title="http://example.com" rel="nofollow">http://example.com</a><pre>junk</pre>
4598 !!end
4600 !!test
4601 Fuzz testing: image with bogus manual thumbnail
4602 !!input
4603 [[Image:foobar.jpg|thumbnail= ]]
4604 !!result
4605 <div class="thumb tright"><div style="width:182px;"><a href="/wiki/Image:Foobar.jpg" class="internal" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="180" height="-1" longdesc="/wiki/Image:Foobar.jpg" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/wiki/Image:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="Enlarge" /></a></div></div></div></div>
4607 !!end
4609 !! test
4610 Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
4611 !! input
4612 <pre dir="&#10;"></pre>
4613 !! result
4614 <pre dir="&#10;"></pre>
4616 !! end
4618 !! test
4619 TODO: Parsing optional HTML elements (Bug 6171)
4620 !! options
4621 !! input
4622 <table>
4623   <tr>
4624     <td> Some tabular data</td>
4625     <td> More tabular data ...
4626     <td> And yet som tabular data</td>
4627   </tr>
4628 </table>
4629 !! result
4630 <table>
4631   <tr>
4632     <td> Some tabular data</td>
4633     <td> More tabular data ...
4634     </td><td> And yet som tabular data</td>
4635   </tr>
4636 </table>
4638 !! end
4640 !! test
4641 Correct handling of <td>, <tr> (Bug 6171)
4642 !! options
4643 !! input
4644 <table>
4645   <tr>
4646     <td> Some tabular data</td>
4647     <td> More tabular data ...</td>
4648     <td> And yet som tabular data</td>
4649   </tr>
4650 </table>
4651 !! result
4652 <table>
4653   <tr>
4654     <td> Some tabular data</td>
4655     <td> More tabular data ...</td>
4656     <td> And yet som tabular data</td>
4657   </tr>
4658 </table>
4660 !! end
4663 !! test
4664 Parsing crashing regression (fr:JavaScript)
4665 !! input
4666 </body></x>
4667 !! result
4668 <p>&lt;/body&gt;&lt;/x&gt;
4669 </p>
4670 !! end
4672 !! test
4673 Inline wiki vs wiki block nesting
4674 !! input
4675 '''Bold paragraph
4677 New wiki paragraph
4678 !! result
4679 <p><b>Bold paragraph</b>
4680 </p><p>New wiki paragraph
4681 </p>
4682 !! end
4684 !! test
4685 TODO: Inline HTML vs wiki block nesting
4686 !! input
4687 <b>Bold paragraph
4689 New wiki paragraph
4690 !! result
4691 <p><b>Bold paragraph</b>
4692 </p><p>New wiki paragraph
4693 </p>
4694 !! end
4697 !!test
4698 TODO: Mixing markup for italics and bold
4699 !! options
4700 !! input
4701 '''bold''''''bold''bolditalics'''''
4702 !! result
4703 <p><b>bold</b><b>bold<i>bolditalics</i></b>
4704 </p>
4705 !! end
4708 !! article
4709 Xyzzyx
4710 !! text
4711 Article for special page transclusion test
4712 !! endarticle
4714 !! test
4715 Special page transclusion
4716 !! options
4717 !! input
4718 {{Special:Prefixindex/Xyzzyx}}
4719 !! result
4720 <p><br />
4721 </p>
4722 <table style="background: inherit;" border="0" width="100%"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
4724 !! end
4726 !! test
4727 Special page transclusion twice (bug 5021)
4728 !! options
4729 !! input
4730 {{Special:Prefixindex/Xyzzyx}}
4731 {{Special:Prefixindex/Xyzzyx}}
4732 !! result
4733 <p><br />
4734 </p>
4735 <table style="background: inherit;" border="0" width="100%"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
4736 <p><br />
4737 </p>
4738 <table style="background: inherit;" border="0" width="100%"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
4740 !! end
4742 !! test
4743 Invalid header with following text
4744 !! input
4745 = x = y
4746 !! result
4747 <p>= x = y
4748 </p>
4749 !! end
4752 !! test
4753 Section extraction test (section 0)
4754 !! options
4755 section=0
4756 !! input
4757 start
4758 ==a==
4759 ===aa===
4760 ====aaa====
4761 ==b==
4762 ===ba===
4763 ===bb===
4764 ====bba====
4765 ===bc===
4766 ==c==
4767 ===ca===
4768 !! result
4769 start
4770 !! end
4772 !! test
4773 Section extraction test (section 1)
4774 !! options
4775 section=1
4776 !! input
4777 start
4778 ==a==
4779 ===aa===
4780 ====aaa====
4781 ==b==
4782 ===ba===
4783 ===bb===
4784 ====bba====
4785 ===bc===
4786 ==c==
4787 ===ca===
4788 !! result
4789 ==a==
4790 ===aa===
4791 ====aaa====
4792 !! end
4794 !! test
4795 Section extraction test (section 2)
4796 !! options
4797 section=2
4798 !! input
4799 start
4800 ==a==
4801 ===aa===
4802 ====aaa====
4803 ==b==
4804 ===ba===
4805 ===bb===
4806 ====bba====
4807 ===bc===
4808 ==c==
4809 ===ca===
4810 !! result
4811 ===aa===
4812 ====aaa====
4813 !! end
4815 !! test
4816 Section extraction test (section 3)
4817 !! options
4818 section=3
4819 !! input
4820 start
4821 ==a==
4822 ===aa===
4823 ====aaa====
4824 ==b==
4825 ===ba===
4826 ===bb===
4827 ====bba====
4828 ===bc===
4829 ==c==
4830 ===ca===
4831 !! result
4832 ====aaa====
4833 !! end
4835 !! test
4836 Section extraction test (section 4)
4837 !! options
4838 section=4
4839 !! input
4840 start
4841 ==a==
4842 ===aa===
4843 ====aaa====
4844 ==b==
4845 ===ba===
4846 ===bb===
4847 ====bba====
4848 ===bc===
4849 ==c==
4850 ===ca===
4851 !! result
4852 ==b==
4853 ===ba===
4854 ===bb===
4855 ====bba====
4856 ===bc===
4857 !! end
4859 !! test
4860 Section extraction test (section 5)
4861 !! options
4862 section=5
4863 !! input
4864 start
4865 ==a==
4866 ===aa===
4867 ====aaa====
4868 ==b==
4869 ===ba===
4870 ===bb===
4871 ====bba====
4872 ===bc===
4873 ==c==
4874 ===ca===
4875 !! result
4876 ===ba===
4877 !! end
4879 !! test
4880 Section extraction test (section 6)
4881 !! options
4882 section=6
4883 !! input
4884 start
4885 ==a==
4886 ===aa===
4887 ====aaa====
4888 ==b==
4889 ===ba===
4890 ===bb===
4891 ====bba====
4892 ===bc===
4893 ==c==
4894 ===ca===
4895 !! result
4896 ===bb===
4897 ====bba====
4898 !! end
4900 !! test
4901 Section extraction test (section 7)
4902 !! options
4903 section=7
4904 !! input
4905 start
4906 ==a==
4907 ===aa===
4908 ====aaa====
4909 ==b==
4910 ===ba===
4911 ===bb===
4912 ====bba====
4913 ===bc===
4914 ==c==
4915 ===ca===
4916 !! result
4917 ====bba====
4918 !! end
4920 !! test
4921 Section extraction test (section 8)
4922 !! options
4923 section=8
4924 !! input
4925 start
4926 ==a==
4927 ===aa===
4928 ====aaa====
4929 ==b==
4930 ===ba===
4931 ===bb===
4932 ====bba====
4933 ===bc===
4934 ==c==
4935 ===ca===
4936 !! result
4937 ===bc===
4938 !! end
4940 !! test
4941 Section extraction test (section 9)
4942 !! options
4943 section=9
4944 !! input
4945 start
4946 ==a==
4947 ===aa===
4948 ====aaa====
4949 ==b==
4950 ===ba===
4951 ===bb===
4952 ====bba====
4953 ===bc===
4954 ==c==
4955 ===ca===
4956 !! result
4957 ==c==
4958 ===ca===
4959 !! end
4961 !! test
4962 Section extraction test (section 10)
4963 !! options
4964 section=10
4965 !! input
4966 start
4967 ==a==
4968 ===aa===
4969 ====aaa====
4970 ==b==
4971 ===ba===
4972 ===bb===
4973 ====bba====
4974 ===bc===
4975 ==c==
4976 ===ca===
4977 !! result
4978 ===ca===
4979 !! end
4981 !! test
4982 Section extraction test (nonexistent section 11)
4983 !! options
4984 section=11
4985 !! input
4986 start
4987 ==a==
4988 ===aa===
4989 ====aaa====
4990 ==b==
4991 ===ba===
4992 ===bb===
4993 ====bba====
4994 ===bc===
4995 ==c==
4996 ===ca===
4997 !! result
4998 !! end
5000 !! test
5001 Section extraction test with bogus heading (section 1)
5002 !! options
5003 section=1
5004 !! input
5005 ==a==
5006 ==bogus== not a legal section
5007 ==b==
5008 !! result
5009 ==a==
5010 ==bogus== not a legal section
5011 !! end
5013 !! test
5014 Section extraction test with bogus heading (section 2)
5015 !! options
5016 section=2
5017 !! input
5018 ==a==
5019 ==bogus== not a legal section
5020 ==b==
5021 !! result
5022 ==b==
5023 !! end
5025 !! test
5026 Section extraction test with comment after heading (section 1)
5027 !! options
5028 section=1
5029 !! input
5030 ==a==
5031 ==legal== <!-- a legal section -->
5032 ==b==
5033 !! result
5034 ==a==
5035 !! end
5037 !! test
5038 Section extraction test with comment after heading (section 2)
5039 !! options
5040 section=2
5041 !! input
5042 ==a==
5043 ==legal== <!-- a legal section -->
5044 ==b==
5045 !! result
5046 ==legal== <!-- a legal section -->
5047 !! end
5049 !! test
5050 Section extraction test with bogus <nowiki> heading (section 1)
5051 !! options
5052 section=1
5053 !! input
5054 ==a==
5055 ==bogus== <nowiki>not a legal section</nowiki>
5056 ==b==
5057 !! result
5058 ==a==
5059 ==bogus== <nowiki>not a legal section</nowiki>
5060 !! end
5062 !! test
5063 Section extraction test with bogus <nowiki> heading (section 2)
5064 !! options
5065 section=2
5066 !! input
5067 ==a==
5068 ==bogus== <nowiki>not a legal section</nowiki>
5069 ==b==
5070 !! result
5071 ==b==
5072 !! end
5075 !! test
5076 Section extraction prefixed by comment (section 1) (bug 2587)
5077 !! options
5078 section=1
5079 !! input
5080 <!-- -->==sec1==
5081 ==sec2==
5082 !!result
5083 <!-- -->==sec1==
5084 !!end
5086 !! test
5087 Section extraction prefixed by comment (section 2) (bug 2587)
5088 !! options
5089 section=2
5090 !! input
5091 <!-- -->==sec1==
5092 ==sec2==
5093 !!result
5094 ==sec2==
5095 !!end
5098 !! test
5099 Section extraction, mixed wiki and html (section 1) (bug 2607)
5100 !! options
5101 section=1
5102 !! input
5103 <h2>1</h2>
5105 ==2==
5107 ==3==
5108 three
5109 !! result
5110 <h2>1</h2>
5112 !! end
5114 !! test
5115 Section extraction, mixed wiki and html (section 2) (bug 2607)
5116 !! options
5117 section=2
5118 !! input
5119 <h2>1</h2>
5121 ==2==
5123 ==3==
5124 three
5125 !! result
5126 ==2==
5128 !! end
5131 !! test
5132 Section extraction, heading surrounded by <noinclude> (bug 3342)
5133 !! options
5134 section=1
5135 !! input
5136 <noinclude>==a==</noinclude>
5137 text
5138 !! result
5139 <noinclude>==a==</noinclude>
5140 text
5141 !!end
5144 !! test
5145 Section extraction, HTML heading subsections (bug 5272)
5146 !! options
5147 section=1
5148 !! input
5149 <h2>a</h2>
5150 <h3>aa</h3>
5151 <h2>b</h2>
5152 !! result
5153 <h2>a</h2>
5154 <h3>aa</h3>
5155 !! end
5157 !! test
5158 Section extraction, HTML headings should be ignored in extensions (bug 3476)
5159 !! options
5160 section=2
5161 !! input
5162 <h2>a</h2>
5163 <tag>
5164 <h2>not b</h2>
5165 </tag>
5166 <h2>b</h2>
5167 !! result
5168 <h2>b</h2>
5169 !! end
5171 !! test
5172 Section replacement test (section 0)
5173 !! options
5174 replace=0,"xxx"
5175 !! input
5176 start
5177 ==a==
5178 ===aa===
5179 ====aaa====
5180 ==b==
5181 ===ba===
5182 ===bb===
5183 ====bba====
5184 ===bc===
5185 ==c==
5186 ===ca===
5187 !! result
5190 ==a==
5191 ===aa===
5192 ====aaa====
5193 ==b==
5194 ===ba===
5195 ===bb===
5196 ====bba====
5197 ===bc===
5198 ==c==
5199 ===ca===
5200 !! end
5202 !! test
5203 Section replacement test (section 1)
5204 !! options
5205 replace=1,"xxx"
5206 !! input
5207 start
5208 ==a==
5209 ===aa===
5210 ====aaa====
5211 ==b==
5212 ===ba===
5213 ===bb===
5214 ====bba====
5215 ===bc===
5216 ==c==
5217 ===ca===
5218 !! result
5219 start
5222 ==b==
5223 ===ba===
5224 ===bb===
5225 ====bba====
5226 ===bc===
5227 ==c==
5228 ===ca===
5229 !! end
5231 !! test
5232 Section replacement test (section 2)
5233 !! options
5234 replace=2,"xxx"
5235 !! input
5236 start
5237 ==a==
5238 ===aa===
5239 ====aaa====
5240 ==b==
5241 ===ba===
5242 ===bb===
5243 ====bba====
5244 ===bc===
5245 ==c==
5246 ===ca===
5247 !! result
5248 start
5249 ==a==
5252 ==b==
5253 ===ba===
5254 ===bb===
5255 ====bba====
5256 ===bc===
5257 ==c==
5258 ===ca===
5259 !! end
5261 !! test
5262 Section replacement test (section 3)
5263 !! options
5264 replace=3,"xxx"
5265 !! input
5266 start
5267 ==a==
5268 ===aa===
5269 ====aaa====
5270 ==b==
5271 ===ba===
5272 ===bb===
5273 ====bba====
5274 ===bc===
5275 ==c==
5276 ===ca===
5277 !! result
5278 start
5279 ==a==
5280 ===aa===
5283 ==b==
5284 ===ba===
5285 ===bb===
5286 ====bba====
5287 ===bc===
5288 ==c==
5289 ===ca===
5290 !! end
5292 !! test
5293 Section replacement test (section 4)
5294 !! options
5295 replace=4,"xxx"
5296 !! input
5297 start
5298 ==a==
5299 ===aa===
5300 ====aaa====
5301 ==b==
5302 ===ba===
5303 ===bb===
5304 ====bba====
5305 ===bc===
5306 ==c==
5307 ===ca===
5308 !! result
5309 start
5310 ==a==
5311 ===aa===
5312 ====aaa====
5315 ==c==
5316 ===ca===
5317 !! end
5319 !! test
5320 Section replacement test (section 5)
5321 !! options
5322 replace=5,"xxx"
5323 !! input
5324 start
5325 ==a==
5326 ===aa===
5327 ====aaa====
5328 ==b==
5329 ===ba===
5330 ===bb===
5331 ====bba====
5332 ===bc===
5333 ==c==
5334 ===ca===
5335 !! result
5336 start
5337 ==a==
5338 ===aa===
5339 ====aaa====
5340 ==b==
5343 ===bb===
5344 ====bba====
5345 ===bc===
5346 ==c==
5347 ===ca===
5348 !! end
5350 !! test
5351 Section replacement test (section 6)
5352 !! options
5353 replace=6,"xxx"
5354 !! input
5355 start
5356 ==a==
5357 ===aa===
5358 ====aaa====
5359 ==b==
5360 ===ba===
5361 ===bb===
5362 ====bba====
5363 ===bc===
5364 ==c==
5365 ===ca===
5366 !! result
5367 start
5368 ==a==
5369 ===aa===
5370 ====aaa====
5371 ==b==
5372 ===ba===
5375 ===bc===
5376 ==c==
5377 ===ca===
5378 !! end
5380 !! test
5381 Section replacement test (section 7)
5382 !! options
5383 replace=7,"xxx"
5384 !! input
5385 start
5386 ==a==
5387 ===aa===
5388 ====aaa====
5389 ==b==
5390 ===ba===
5391 ===bb===
5392 ====bba====
5393 ===bc===
5394 ==c==
5395 ===ca===
5396 !! result
5397 start
5398 ==a==
5399 ===aa===
5400 ====aaa====
5401 ==b==
5402 ===ba===
5403 ===bb===
5406 ===bc===
5407 ==c==
5408 ===ca===
5409 !! end
5411 !! test
5412 Section replacement test (section 8)
5413 !! options
5414 replace=8,"xxx"
5415 !! input
5416 start
5417 ==a==
5418 ===aa===
5419 ====aaa====
5420 ==b==
5421 ===ba===
5422 ===bb===
5423 ====bba====
5424 ===bc===
5425 ==c==
5426 ===ca===
5427 !! result
5428 start
5429 ==a==
5430 ===aa===
5431 ====aaa====
5432 ==b==
5433 ===ba===
5434 ===bb===
5435 ====bba====
5438 ==c==
5439 ===ca===
5440 !!end
5442 !! test
5443 Section replacement test (section 9)
5444 !! options
5445 replace=9,"xxx"
5446 !! input
5447 start
5448 ==a==
5449 ===aa===
5450 ====aaa====
5451 ==b==
5452 ===ba===
5453 ===bb===
5454 ====bba====
5455 ===bc===
5456 ==c==
5457 ===ca===
5458 !! result
5459 start
5460 ==a==
5461 ===aa===
5462 ====aaa====
5463 ==b==
5464 ===ba===
5465 ===bb===
5466 ====bba====
5467 ===bc===
5469 !! end
5471 !! test
5472 Section replacement test (section 10)
5473 !! options
5474 replace=10,"xxx"
5475 !! input
5476 start
5477 ==a==
5478 ===aa===
5479 ====aaa====
5480 ==b==
5481 ===ba===
5482 ===bb===
5483 ====bba====
5484 ===bc===
5485 ==c==
5486 ===ca===
5487 !! result
5488 start
5489 ==a==
5490 ===aa===
5491 ====aaa====
5492 ==b==
5493 ===ba===
5494 ===bb===
5495 ====bba====
5496 ===bc===
5497 ==c==
5499 !! end
5502 !! test
5503 Section extraction, HTML headings not at line boundaries (section 0)
5504 !! options
5505 section=0
5506 !! input
5507 <h2>Evil</h2><i>blah blah blah</i>
5509 evil blah
5511 <h2>Nice</h2>
5513 nice blah
5515 <i>extra evil</i><h2>Extra nasty</h2>
5517 extra nasty
5518 !! result
5519 !! end
5521 !! test
5522 Section extraction, HTML headings not at line boundaries (section 1)
5523 !! options
5524 section=1
5525 !! input
5526 <h2>Evil</h2><i>blah blah blah</i>
5528 evil blah
5530 <h2>Nice</h2>
5532 nice blah
5534 <i>extra evil</i><h2>Extra nasty</h2>
5536 extra nasty
5537 !! result
5538 <h2>Evil</h2><i>blah blah blah</i>
5540 evil blah
5541 !! end
5543 !! test
5544 Section extraction, HTML headings not at line boundaries (section 2)
5545 !! options
5546 section=2
5547 !! input
5548 <h2>Evil</h2><i>blah blah blah</i>
5550 evil blah
5552 <h2>Nice</h2>
5554 nice blah
5556 <i>extra evil</i><h2>Extra nasty</h2>
5558 extra nasty
5559 !! result
5560 <h2>Nice</h2>
5562 nice blah
5564 <i>extra evil</i>
5565 !! end
5567 !! test
5568 Section extraction, HTML headings not at line boundaries (section 3)
5569 !! options
5570 section=3
5571 !! input
5572 <h2>Evil</h2><i>blah blah blah</i>
5574 evil blah
5576 <h2>Nice</h2>
5578 nice blah
5580 <i>extra evil</i><h2>Extra nasty</h2>
5582 extra nasty
5583 !! result
5584 <h2>Extra nasty</h2>
5586 extra nasty
5587 !! end
5590 !! test
5591 Section extraction, heading followed by pre with 20 spaces (bug 6398)
5592 !! options
5593 section=1
5594 !! input
5595 ==a==
5596                     a
5597 !! result
5598 ==a==
5599                     a
5600 !! end
5602 !! test
5603 Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check)
5604 !! options
5605 section=1
5606 !! input
5607 ==a==
5608                    a
5609 !! result
5610 ==a==
5611                    a
5612 !! end
5614 !! test
5615 Handling of &#x0A; in URLs
5616 !! input
5617 **irc://&#x0A;a
5618 !! result
5619 <ul><li><ul><li><a href="irc://%0Aa" class="external free" title="irc://%0Aa" rel="nofollow">irc://%0Aa</a>
5620 </li></ul>
5621 </li></ul>
5623 !!end
5625 !! test
5626 TODO: 5 quotes, code coverage +1 line
5627 !! input
5628 '''''
5629 !! result
5630 !! end
5632 !! test
5633 Special:Search page linking.
5634 !! input
5635 {{Special:search}}
5636 !! result
5637 <p><a href="/wiki/Special:Search" title="Special:Search">Special:Search</a>
5638 </p>
5639 !! end
5641 !! test
5642 Say the magic word
5643 !! input
5644 * {{PAGENAME}}
5645 * {{BASEPAGENAME}}
5646 * {{SUBPAGENAME}}
5647 * {{SUBPAGENAMEE}}
5648 * {{BASEPAGENAME}}
5649 * {{BASEPAGENAMEE}}
5650 * {{TALKPAGENAME}}
5651 * {{TALKPAGENAMEE}}
5652 * {{SUBJECTPAGENAME}}
5653 * {{SUBJECTPAGENAMEE}}
5654 * {{NAMESPACEE}}
5655 * {{NAMESPACE}}
5656 * {{TALKSPACE}}
5657 * {{TALKSPACEE}}
5658 * {{SUBJECTSPACE}}
5659 * {{SUBJECTSPACEE}}
5660 * {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
5661 !! result
5662 <ul><li> Parser test
5663 </li><li> Parser test
5664 </li><li> Parser test
5665 </li><li> Parser_test
5666 </li><li> Parser test
5667 </li><li> Parser_test
5668 </li><li> Talk:Parser test
5669 </li><li> Talk:Parser_test
5670 </li><li> Parser test
5671 </li><li> Parser_test
5672 </li><li> 
5673 </li><li> 
5674 </li><li> Talk
5675 </li><li> Talk
5676 </li><li> 
5677 </li><li> 
5678 </li><li> <a href="/index.php?title=Template:Dynamic&amp;action=edit" class="new" title="Template:Dynamic">Template:Dynamic</a>
5679 </li></ul>
5681 !! end
5682 ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included.
5684 !! test
5685 Gallery
5686 !! input
5687 <gallery>
5688 image1.png |
5689 image2.gif|||||
5691 image3|
5692 image4    |300px| centre
5693  image5.svg| http://///////
5694 [[x|xx]]]]
5695 * image6
5696 </gallery>
5697 !! result
5698 <table class="gallery" cellspacing="0" cellpadding="0"><tr><td><div class="gallerybox"><div style="height: 152px;">Image1.png</div><div class="gallerytext">
5699 </div></div></td>
5700 <td><div class="gallerybox"><div style="height: 152px;">Image2.gif</div><div class="gallerytext">
5701 ||||</div></div></td>
5702 <td><div class="gallerybox"><div style="height: 152px;">Image3</div><div class="gallerytext">
5703 </div></div></td>
5704 <td><div class="gallerybox"><div style="height: 152px;">Image4</div><div class="gallerytext">
5705 300px| centre</div></div></td>
5706 </tr><tr><td><div class="gallerybox"><div style="height: 152px;">Image5.svg</div><div class="gallerytext">
5707  <a href="http://///////" class="external free" title="http://///////" rel="nofollow">http://///////</a></div></div></td>
5708 <td><div class="gallerybox"><div style="height: 152px;">* image6</div><div class="gallerytext">
5709 </div></div></td>
5710 </tr>
5711 </table>
5713 !! end
5715 !! test
5716 TODO: HTML Hex character encoding.
5717 !! input
5718 &#x4A;&#x061;&#x0076;&#x00061;&#x000053;&#x0000063;&#114;&#x0000069;&#00000112;&#x0000000074;
5719 !! result
5720 <p>JavaScript
5721 </p>
5722 !! end
5724 !! test
5725 __FORCETOC__ override
5726 !! input 
5727 __NEWSECTIONLINK__
5728 __FORCETOC__
5729 !! result
5730 <p><br />
5731 </p>
5732 !! end
5734 !! test
5735 ISBN code coverage
5736 !! input
5737 ISBN  983&#x20;987
5738 !! result
5739 <p><a href="/index.php?title=Special:Booksources&amp;isbn=983" class="internal">ISBN 983</a>&#x20;987
5740 </p>
5741 !! end
5743 !! test
5744 ISBN followed by 5 spaces
5745 !! input
5746 ISBN    
5747 !! result
5748 <p>ISBN    
5749 </p>
5750 !! end
5752 !! test
5753 Double ISBN
5754 !! options
5755 disabled # Disabled until Bug 6560 resolved
5756 !! input
5757 ISBN ISBN 1234
5758 !! result
5759 <p>ISBN <a href="/wiki/index.php?title=Special:Booksources&amp;isbn=1234" class="internal">ISBN 1234</a>
5760 </p>
5761 !! end
5763 !! test
5764 Double RFC
5765 !! input
5766 RFC RFC 1234
5767 !! result
5768 <p>RFC <a href="http://www.ietf.org/rfc/rfc1234.txt" class="external" title="http://www.ietf.org/rfc/rfc1234.txt">RFC 1234</a>
5769 </p>
5770 !! end
5772 !! test
5773 Double RFC with a wiki link 
5774 !! input
5775 RFC [[RFC 1234]]
5776 !! result
5777 <p>RFC <a href="/index.php?title=RFC_1234&amp;action=edit" class="new" title="RFC 1234">RFC 1234</a>
5778 </p>
5779 !! end
5781 !! test
5782 RFC code coverage
5783 !! input
5784 RFC   983&#x20;987
5785 !! result
5786 <p><a href="http://www.ietf.org/rfc/rfc983.txt" class="external" title="http://www.ietf.org/rfc/rfc983.txt">RFC 983</a>&#x20;987
5787 </p>
5788 !! end
5790 !! test
5791 Centre-aligned image
5792 !! input
5793 [[Image:foobar.jpg|centre]]
5794 !! result
5795 <div class="center"><div class="floatnone"><span><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div></div>
5797 !!end
5799 !! test
5800 None-aligned image
5801 !! input
5802 [[Image:foobar.jpg|none]]
5803 !! result
5804 <div class="floatnone"><span><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="http://example.com/images/3/3a/Foobar.jpg" alt="" width="1941" height="220" longdesc="/wiki/Image:Foobar.jpg" /></a></span></div>
5806 !!end
5808 !! test
5809 Width + Height sized image (using px) (height is ignored)
5810 !! input
5811 [[Image:foobar.jpg|640x480px]]
5812 !! result
5813 <p><a href="/wiki/Image:Foobar.jpg" class="image" title=""><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" alt="" width="640" height="73" longdesc="/wiki/Image:Foobar.jpg" /></a>
5814 </p>
5815 !!end
5817 !! test
5818 Another italics / bold test
5819 !! input
5820  ''' ''x'
5821 !! result
5822 <pre>'<i> </i>x'
5823 </pre>
5824 !!end
5826 # Note the results may be incorrect, as parserTest output included this:
5827 # XML error: Mismatched tag at byte 6120:
5828 # ...<dd> </dt></dl> </dd...
5829 !! test
5830 TODO: dt/dd/dl test
5831 !! input
5832 :;;;::
5833 !! result
5834 <dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd>
5835 </dt></dl>
5836 </dd></dl>
5837 </dd></dl>
5838 </dd></dl>
5839 </dd></dl>
5840 </dd></dl>
5842 !!end
5848 TODO:
5849 more images
5850 more tables
5851 math
5852 character entities
5853 and much more
5854 Try for 100% code coverage