Maintenance script to import the contents of a text file into a wiki page
[lhc/web/wiklou.git] / maintenance / parserTests.txt
1 # MediaWiki Parser test cases
2 # Some taken from http://meta.wikimedia.org/wiki/Parser_testing
3 # All (C) their respective authors and released under the GPL
4 #
5 # The syntax should be fairly self-explanatory.
6 #
7 # Currently supported test options:
8 # One of the following three:
9 #
10 # (default) generate HTML output
11 # pst apply pre-save transform
12 # msg apply message transform
13 #
14 # Plus any combination of these:
15 #
16 # cat add category links
17 # ill add inter-language links
18 # subpage enable subpages (disabled by default)
19 # noxml don't check for XML well formdness
20 # title=[[XXX]] run test using article title XXX
21 # disabled do not run test
22 #
23 # For testing purposes, temporary articles can created:
24 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
25 # where '/' denotes a newline.
26
27 # This is the standard article assumed to exist.
28 !! article
29 Main Page
30 !! text
31 blah blah
32 !! endarticle
33
34 ###
35 ### Basic tests
36 ###
37 !! test
38 Blank input
39 !! input
40 !! result
41 !! end
42
43
44 !! test
45 Simple paragraph
46 !! input
47 This is a simple paragraph.
48 !! result
49 <p>This is a simple paragraph.
50 </p>
51 !! end
52
53 !! test
54 Simple list
55 !! input
56 * Item 1
57 * Item 2
58 !! result
59 <ul><li> Item 1
60 </li><li> Item 2
61 </li></ul>
62
63 !! end
64
65 !! test
66 Italics and bold
67 !! input
68 * plain
69 * plain''italic''plain
70 * plain''italic''plain''italic''plain
71 * plain'''bold'''plain
72 * plain'''bold'''plain'''bold'''plain
73 * plain''italic''plain'''bold'''plain
74 * plain'''bold'''plain''italic''plain
75 * plain''italic'''bold-italic'''italic''plain
76 * plain'''bold''bold-italic''bold'''plain
77 * plain'''''bold-italic'''italic''plain
78 * plain'''''bold-italic''bold'''plain
79 * plain''italic'''bold-italic'''''plain
80 * plain'''bold''bold-italic'''''plain
81 * plain l'''italic''plain
82 !! result
83 <ul><li> plain
84 </li><li> plain<i>italic</i>plain
85 </li><li> plain<i>italic</i>plain<i>italic</i>plain
86 </li><li> plain<b>bold</b>plain
87 </li><li> plain<b>bold</b>plain<b>bold</b>plain
88 </li><li> plain<i>italic</i>plain<b>bold</b>plain
89 </li><li> plain<b>bold</b>plain<i>italic</i>plain
90 </li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
91 </li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
92 </li><li> plain<i><b>bold-italic</b>italic</i>plain
93 </li><li> plain<b><i>bold-italic</i>bold</b>plain
94 </li><li> plain<i>italic<b>bold-italic</b></i>plain
95 </li><li> plain<b>bold<i>bold-italic</i></b>plain
96 </li><li> plain l'<i>italic</i>plain
97 </li></ul>
98
99 !! end
100
101 ###
102 ### <nowiki> test cases
103 ###
104
105 !! test
106 <nowiki> unordered list
107 !! input
108 <nowiki>* This is not an unordered list item.</nowiki>
109 !! result
110 <p>* This is not an unordered list item.
111 </p>
112 !! end
113
114 !! test
115 <nowiki> spacing
116 !! input
117 <nowiki>Lorem ipsum dolor
118
119 sed abit.
120 sed nullum.
121
122 :and a colon
123 </nowiki>
124 !! result
125 <p>Lorem ipsum dolor
126
127 sed abit.
128 sed nullum.
129
130 :and a colon
131
132 </p>
133 !! end
134
135 !! test
136 nowiki 3
137 !! input
138 :There is not nowiki.
139 :There is <nowiki>nowiki</nowiki>.
140
141 #There is not nowiki.
142 #There is <nowiki>nowiki</nowiki>.
143
144 *There is not nowiki.
145 *There is <nowiki>nowiki</nowiki>.
146 !! result
147 <dl><dd>There is not nowiki.
148 </dd><dd>There is nowiki.
149 </dd></dl>
150 <ol><li>There is not nowiki.
151 </li><li>There is nowiki.
152 </li></ol>
153 <ul><li>There is not nowiki.
154 </li><li>There is nowiki.
155 </li></ul>
156
157 !! end
158
159 ###
160 ### Comments
161 ###
162 !! test
163 Comment test 1
164 !! input
165 <!-- comment 1 --> asdf
166 <!-- comment 2 -->
167 !! result
168 <pre>asdf
169 </pre>
170
171 !! end
172
173 !! test
174 Comment test 2
175 !! input
176 asdf
177 <!-- comment 1 -->
178 jkl
179 !! result
180 <p>asdf
181 jkl
182 </p>
183 !! end
184
185 !! test
186 Comment test 3
187 !! input
188 asdf
189 <!-- comment 1 -->
190 <!-- comment 2 -->
191 jkl
192 !! result
193 <p>asdf
194 jkl
195 </p>
196 !! end
197
198 !! test
199 Comment test 4
200 !! input
201 asdf<!-- comment 1 -->jkl
202 !! result
203 <p>asdfjkl
204 </p>
205 !! end
206
207 !! test
208 Comment spacing
209 !! input
210 a
211 <!-- foo --> b <!-- bar -->
212 c
213 !! result
214 <p>a
215 </p>
216 <pre> b
217 </pre>
218 <p>c
219 </p>
220 !! end
221
222 !! test
223 Comment whitespace
224 !! input
225 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
226 !! result
227
228 !! end
229
230 !! test
231 Comment semantics and delimiters
232 !! input
233 <!-- --><!----><!-----><!------>
234 !! result
235
236 !! end
237
238 !! test
239 Comment semantics and delimiters, redux
240 !! input
241 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
242 -- foo -- funky huh? ... -->
243 !! result
244
245 !! end
246
247 !! test
248 Comment semantics and delimiters: directors cut
249 !! input
250 <!-- ... However we like to keep things simple and somewhat XML-ish so we eat
251 everything starting with < followed by !-- until the first -- and > we see,
252 that wouldn't be valid XML however, since in XML -- has to terminate a comment
253 -->-->
254 !! result
255 <p>-->
256 </p>
257 !! end
258
259 !! test
260 Comment semantics: nesting
261 !! input
262 <!--<!-- no, we're not going to do anything fancy here -->-->
263 !! result
264 <p>-->
265 </p>
266 !! end
267
268
269 ###
270 ### Preformatted text
271 ###
272 !! test
273 Preformatted text
274 !! input
275 This is some
276 Preformatted text
277 With ''italic''
278 And '''bold'''
279 And a [[Main Page|link]]
280 !! result
281 <pre>This is some
282 Preformatted text
283 With <i>italic</i>
284 And <b>bold</b>
285 And a <a href="/wiki/Main_Page" title="Main Page">link</a>
286 </pre>
287 !! end
288
289 ###
290 ### Definition lists
291 ###
292 !! test
293 Simple definition
294 !! input
295 ; name : Definition
296 !! result
297 <dl><dt> name&nbsp;</dt><dd> Definition
298 </dd></dl>
299
300 !! end
301
302 !! test
303 Simple definition
304 !! input
305 : Indented text
306 !! result
307 <dl><dd> Indented text
308 </dd></dl>
309
310 !! end
311
312 !! test
313 Definition list with no space
314 !! input
315 ;name:Definition
316 !! result
317 <dl><dt>name</dt><dd>Definition
318 </dd></dl>
319
320 !!end
321
322 !! test
323 Definition list with URL link
324 !! input
325 ; http://example.com/ : definition
326 !! result
327 <dl><dt> <a href="http://example.com/" class='external free' title="http://example.com/" rel="nofollow">http://example.com/</a>&nbsp;</dt><dd> definition
328 </dd></dl>
329
330 !! end
331
332 !! test
333 Definition list with bracketed URL link
334 !! input
335 ;[http://www.example.com/ Example]:Something about it
336 !! result
337 <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
338 </dd></dl>
339
340 !! end
341
342 !! test
343 Definition list with wikilink containing colon
344 !! input
345 ; [[Help:FAQ]]: The least-read page on Wikipedia
346 !! result
347 <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
348 </dd></dl>
349
350 !! end
351
352 # At Brion's and JeLuF's insistence... :)
353 !! test
354 Definition list with wikilink containing colon
355 !! input
356 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
357 !! result
358 <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!
359 </dd></dl>
360
361 !! end
362
363 !! test
364 Malformed definition list with colon
365 !! input
366 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
367 !! result
368 <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
369 </dt></dl>
370
371 !! end
372
373 !! test
374 Definition lists: colon in external link text
375 !! input
376 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
377 !! result
378 <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
379 </dd></dl>
380
381 !! end
382
383
384 ###
385 ### External links
386 ###
387 !! test
388 External links: non-bracketed
389 !! input
390 Non-bracketed: http://example.com
391 !! result
392 <p>Non-bracketed: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
393 </p>
394 !! end
395
396 !! test
397 External links: numbered
398 !! input
399 Numbered: [http://example.com]
400 Numbered: [http://example.net]
401 Numbered: [http://example.org]
402 !! result
403 <p>Numbered: <a href="http://example.com" class='external autonumber' title="http://example.com" rel="nofollow">[1]</a>
404 Numbered: <a href="http://example.net" class='external autonumber' title="http://example.net" rel="nofollow">[2]</a>
405 Numbered: <a href="http://example.org" class='external autonumber' title="http://example.org" rel="nofollow">[3]</a>
406 </p>
407 !!end
408
409 !! test
410 External links: specified text
411 !! input
412 Specified text: [http://example.com link]
413 !! result
414 <p>Specified text: <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow">link</a>
415 </p>
416 !!end
417
418 !! test
419 External links: trail
420 !! input
421 Linktrails should not work for external links: [http://example.com link]s
422 !! result
423 <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
424 </p>
425 !! end
426
427 !! test
428 External links: dollar sign in URL
429 !! input
430 http://example.com/1$2345
431 !! result
432 <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>
433 </p>
434 !! end
435
436 !! test
437 External links: dollar sign in URL (named)
438 !! input
439 [http://example.com/1$2345]
440 !! result
441 <p><a href="http://example.com/1$2345" class='external autonumber' title="http://example.com/1$2345" rel="nofollow">[1]</a>
442 </p>
443 !!end
444
445 !! test
446 External links: open square bracket forbidden in URL (bug 4377)
447 !! input
448 http://example.com/1[2345
449 !! result
450 <p><a href="http://example.com/1" class='external free' title="http://example.com/1" rel="nofollow">http://example.com/1</a>[2345
451 </p>
452 !! end
453
454 !! test
455 External links: open square bracket forbidden in URL (named) (bug 4377)
456 !! input
457 [http://example.com/1[2345]
458 !! result
459 <p><a href="http://example.com/1" class='external text' title="http://example.com/1" rel="nofollow">[2345</a>
460 </p>
461 !!end
462
463 !! test
464 External image
465 !! input
466 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
467 !! result
468 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
469 </p>
470 !! end
471
472 !! test
473 External image from https
474 !! input
475 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
476 !! result
477 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
478 </p>
479 !! end
480
481 !! test
482 Link to non-http image, no img tag
483 !! input
484 Link to non-http image, no img tag: ftp://example.com/test.jpg
485 !! result
486 <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>
487 </p>
488 !! end
489
490 !! test
491 External links: terminating separator
492 !! input
493 Terminating separator: http://example.com/thing,
494 !! result
495 <p>Terminating separator: <a href="http://example.com/thing" class='external free' title="http://example.com/thing" rel="nofollow">http://example.com/thing</a>,
496 </p>
497 !! end
498
499 !! test
500 External links: intervening separator
501 !! input
502 Intervening separator: http://example.com/1,2,3
503 !! result
504 <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>
505 </p>
506 !! end
507
508 !! test
509 External links: old bug with URL in query
510 !! input
511 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
512 !! result
513 <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>
514 </p>
515 !! end
516
517 !! test
518 External links: old URL-in-URL bug, mixed protocols
519 !! input
520 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
521 !! result
522 <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>
523 </p>
524 !!end
525
526 !! test
527 External links: URL in text
528 !! input
529 URL in text: [http://example.com http://example.com]
530 !! result
531 <p>URL in text: <a href="http://example.com" class='external free' title="http://example.com" rel="nofollow">http://example.com</a>
532 </p>
533 !! end
534
535 !! test
536 External links: Clickable images
537 !! input
538 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
539 !! result
540 <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>
541 </p>
542 !!end
543
544 !! test
545 External links: raw ampersand
546 !! input
547 Old &amp; use: http://x&y
548 !! result
549 <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>
550 </p>
551 !! end
552
553 !! test
554 External links: encoded ampersand
555 !! input
556 Old &amp; use: http://x&amp;y
557 !! result
558 <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>
559 </p>
560 !! end
561
562 !! test
563 External links: [raw ampersand]
564 !! input
565 Old &amp; use: [http://x&y]
566 !! result
567 <p>Old &amp; use: <a href="http://x&amp;y" class='external autonumber' title="http://x&amp;y" rel="nofollow">[1]</a>
568 </p>
569 !! end
570
571 !! test
572 External links: [encoded ampersand]
573 !! input
574 Old &amp; use: [http://x&amp;y]
575 !! result
576 <p>Old &amp; use: <a href="http://x&amp;y" class='external autonumber' title="http://x&amp;y" rel="nofollow">[1]</a>
577 </p>
578 !! end
579
580 !! test
581 External links: www.jpeg.org (bug 554)
582 !! input
583 http://www.jpeg.org
584 !!result
585 <p><a href="http://www.jpeg.org" class='external free' title="http://www.jpeg.org" rel="nofollow">http://www.jpeg.org</a>
586 </p>
587 !! end
588
589 !! test
590 External links: URL within URL (original bug 2)
591 !! input
592 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
593 !! result
594 <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>
595 </p>
596 !! end
597
598 !! test
599 BUG 361: URL inside bracketed URL
600 !! input
601 [http://www.example.com/foo http://www.example.com/bar]
602 !! result
603 <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>
604 </p>
605 !! end
606
607 !! test
608 BUG 361: URL within URL, not bracketed
609 !! input
610 http://www.example.com/foo?=http://www.example.com/bar
611 !! result
612 <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>
613 </p>
614 !! end
615
616 !! test
617 BUG 289: ">"-token in URL-tail
618 !! input
619 http://www.example.com/<hello>
620 !! result
621 <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;
622 </p>
623 !!end
624
625 !! test
626 BUG 289: literal ">"-token in URL-tail
627 !! input
628 http://www.example.com/<b>html</b>
629 !! result
630 <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>
631 </p>
632 !!end
633
634 !! test
635 BUG 289: ">"-token in bracketed URL
636 !! input
637 [http://www.example.com/<hello> stuff]
638 !! result
639 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow">&lt;hello&gt; stuff</a>
640 </p>
641 !!end
642
643 !! test
644 BUG 289: literal ">"-token in bracketed URL
645 !! input
646 [http://www.example.com/<b>html</b> stuff]
647 !! result
648 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow"><b>html</b> stuff</a>
649 </p>
650 !!end
651
652 !! test
653 BUG 289: literal double quote at end of URL
654 !! input
655 http://www.example.com/"hello"
656 !! result
657 <p><a href="http://www.example.com/" class='external free' title="http://www.example.com/" rel="nofollow">http://www.example.com/</a>"hello"
658 </p>
659 !!end
660
661 !! test
662 BUG 289: literal double quote in bracketed URL
663 !! input
664 [http://www.example.com/"hello" stuff]
665 !! result
666 <p><a href="http://www.example.com/" class='external text' title="http://www.example.com/" rel="nofollow">"hello" stuff</a>
667 </p>
668 !!end
669
670 !! test
671 External links: invalid character
672 Fixme: the missing char seems to have gone missing
673 !! options
674 disabled
675 !! input
676 [http://www.example.com test]
677 !! result
678 <p>[<a href="http://www.example.com" class='external free' title="http://www.example.com" rel="nofollow">http://www.example.com</a> test]
679 </p>
680 !! end
681
682 !! test
683 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081)
684 !! input
685 [http://www.example.com test]
686 !! result
687 <p><a href="http://www.example.com" class='external text' title="http://www.example.com" rel="nofollow">test</a>
688 </p>
689 !! end
690
691 !! test
692 External links: wiki links within external link (Bug 3695)
693 !! input
694 [http://example.com [[wikilink]] embedded in ext link]
695 !! result
696 <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>
697 </p>
698 !! end
699
700 !! test
701 BUG 787: Links with one slash after the url protocol are invalid
702 !! input
703 http:/example.com
704
705 [http:/example.com title]
706 !! result
707 <p>http:/example.com
708 </p><p>[http:/example.com title]
709 </p>
710 !! end
711
712 !! test
713 Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
714 !! input
715 ''[http://example.com text'']
716 [http://example.com '''text]'''
717 ''Something [http://example.com in italic'']
718 ''Something [http://example.com mixed''''', even bold]'''
719 '''''Now [http://example.com both''''']
720 !! result
721 <p><a href="http://example.com" class='external text' title="http://example.com" rel="nofollow"><i>text</i></a>
722 <a href="http://example.com" class='external text' title="http://example.com" rel="nofollow"><b>text</b></a>
723 <i>Something </i><a href="http://example.com" class='external text' title="http://example.com" rel="nofollow"><i>in italic</i></a>
724 <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>
725 <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>
726 </p>
727 !! end
728
729
730 !! test
731 Bug 4781: %26 in URL
732 !! input
733 http://www.example.com/?title=AT%26T
734 !! result
735 <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>
736 </p>
737 !! end
738
739 !! test
740 Bug 4781, 5267: %26 in URL
741 !! input
742 http://www.example.com/?title=100%25_Bran
743 !! result
744 <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>
745 </p>
746 !! end
747
748 !! test
749 Bug 4781, 5267: %28, %29 in URL
750 !! input
751 http://www.example.com/?title=Ben-Hur_%281959_film%29
752 !! result
753 <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>
754 </p>
755 !! end
756
757
758 !! test
759 Bug 4781: %26 in autonumber URL
760 !! input
761 [http://www.example.com/?title=AT%26T]
762 !! result
763 <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>
764 </p>
765 !! end
766
767 !! test
768 Bug 4781, 5267: %26 in autonumber URL
769 !! input
770 [http://www.example.com/?title=100%25_Bran]
771 !! result
772 <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>
773 </p>
774 !! end
775
776 !! test
777 Bug 4781, 5267: %28, %29 in autonumber URL
778 !! input
779 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
780 !! result
781 <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>
782 </p>
783 !! end
784
785
786 !! test
787 Bug 4781: %26 in bracketed URL
788 !! input
789 [http://www.example.com/?title=AT%26T link]
790 !! result
791 <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>
792 </p>
793 !! end
794
795 !! test
796 Bug 4781, 5267: %26 in bracketed URL
797 !! input
798 [http://www.example.com/?title=100%25_Bran link]
799 !! result
800 <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>
801 </p>
802 !! end
803
804 !! test
805 Bug 4781, 5267: %28, %29 in bracketed URL
806 !! input
807 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
808 !! result
809 <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>
810 </p>
811 !! end
812
813
814 ###
815 ### Quotes
816 ###
817
818 !! test
819 Quotes
820 !! input
821 Normal text. '''Bold text.''' Normal text. ''Italic text.''
822
823 Normal text. '''''Bold italic text.''''' Normal text.
824 !!result
825 <p>Normal text. <b>Bold text.</b> Normal text. <i>Italic text.</i>
826 </p><p>Normal text. <i><b>Bold italic text.</b></i> Normal text.
827 </p>
828 !! end
829
830
831 !! test
832 Unclosed and unmatched quotes
833 !! input
834 '''''Bold italic text '''with bold deactivated''' in between.'''''
835
836 '''''Bold italic text ''with italic deactivated'' in between.'''''
837
838 '''Bold text..
839
840 ..spanning two paragraphs (should not work).'''
841
842 '''Bold tag left open
843
844 ''Italic tag left open
845
846 Normal text.
847
848 <!-- Unmatching number of opening, closing tags: -->
849 '''This year''''s election ''should'' beat '''last year''''s.
850
851 ''Tom'''s car is bigger than ''Susan'''s.
852 !! result
853 <p><i><b>Bold italic text </b>with bold deactivated<b> in between.</b></i>
854 </p><p><b><i>Bold italic text </i>with italic deactivated<i> in between.</i></b>
855 </p><p><b>Bold text..</b>
856 </p><p>..spanning two paragraphs (should not work).
857 </p><p><b>Bold tag left open</b>
858 </p><p><i>Italic tag left open</i>
859 </p><p>Normal text.
860 </p><p><b>This year'</b>s election <i>should</i> beat <b>last year'</b>s.
861 </p><p><i>Tom<b>s car is bigger than </b></i><b>Susan</b>s.
862 </p>
863 !! end
864
865 ###
866 ### Tables
867 ###
868 ### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables
869 ###
870
871 # This should not produce <table></table> as <table><tr><td></td></tr></table>
872 # is the bare minimun required by the spec, see:
873 # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
874 !! test
875 A table with no data.
876 !! input
877 {||}
878 !! result
879 !! end
880
881 # A table with nothing but a caption is invalid XHTML, we might want to render
882 # this as <p>caption</p>
883 !! test
884 A table with nothing but a caption
885 !! input
886 {|
887 |+ caption
888 |}
889 !! result
890 <table>
891 <caption> caption
892 </caption><tr><td></td></tr></table>
893
894 !! end
895
896 !! test
897 Simple table
898 !! input
899 {|
900 | 1 || 2
901 |-
902 | 3 || 4
903 |}
904 !! result
905 <table>
906 <tr>
907 <td> 1 </td><td> 2
908 </td></tr>
909 <tr>
910 <td> 3 </td><td> 4
911 </td></tr></table>
912
913 !! end
914
915 !! test
916 Multiplication table
917 !! input
918 {| border="1" cellpadding="2"
919 |+Multiplication table
920 |-
921 ! &times; !! 1 !! 2 !! 3
922 |-
923 ! 1
924 | 1 || 2 || 3
925 |-
926 ! 2
927 | 2 || 4 || 6
928 |-
929 ! 3
930 | 3 || 6 || 9
931 |-
932 ! 4
933 | 4 || 8 || 12
934 |-
935 ! 5
936 | 5 || 10 || 15
937 |}
938 !! result
939 <table border="1" cellpadding="2">
940 <caption>Multiplication table
941 </caption>
942 <tr>
943 <th> &times; </th><th> 1 </th><th> 2 </th><th> 3
944 </th></tr>
945 <tr>
946 <th> 1
947 </th><td> 1 </td><td> 2 </td><td> 3
948 </td></tr>
949 <tr>
950 <th> 2
951 </th><td> 2 </td><td> 4 </td><td> 6
952 </td></tr>
953 <tr>
954 <th> 3
955 </th><td> 3 </td><td> 6 </td><td> 9
956 </td></tr>
957 <tr>
958 <th> 4
959 </th><td> 4 </td><td> 8 </td><td> 12
960 </td></tr>
961 <tr>
962 <th> 5
963 </th><td> 5 </td><td> 10 </td><td> 15
964 </td></tr></table>
965
966 !! end
967
968 !! test
969 Table rowspan
970 !! input
971 {| align=right border=1
972 | Cell 1, row 1
973 |rowspan=2| Cell 2, row 1 (and 2)
974 | Cell 3, row 1
975 |-
976 | Cell 1, row 2
977 | Cell 3, row 2
978 |}
979 !! result
980 <table align="right" border="1">
981 <tr>
982 <td> Cell 1, row 1
983 </td><td rowspan="2"> Cell 2, row 1 (and 2)
984 </td><td> Cell 3, row 1
985 </td></tr>
986 <tr>
987 <td> Cell 1, row 2
988 </td><td> Cell 3, row 2
989 </td></tr></table>
990
991 !! end
992
993 !! test
994 Nested table
995 !! input
996 {| border=1
997 | &alpha;
998 |
999 {| bgcolor=#ABCDEF border=2
1000 |nested
1001 |-
1002 |table
1003 |}
1004 |the original table again
1005 |}
1006 !! result
1007 <table border="1">
1008 <tr>
1009 <td> &alpha;
1010 </td><td>
1011 <table bgcolor="#ABCDEF" border="2">
1012 <tr>
1013 <td>nested
1014 </td></tr>
1015 <tr>
1016 <td>table
1017 </td></tr></table>
1018 </td><td>the original table again
1019 </td></tr></table>
1020
1021 !! end
1022
1023 !! test
1024 Invalid attributes in table cell (bug 1830)
1025 !! input
1026 {|
1027 |Cell:|broken
1028 |}
1029 !! result
1030 <table>
1031 <tr>
1032 <td>broken
1033 </td></tr></table>
1034
1035 !! end
1036
1037
1038 # FIXME: this one has incorrect tag nesting still.
1039 !! test
1040 Table security: embedded pipes (http://mail.wikipedia.org/pipermail/wikitech-l/2006-April/034637.html)
1041 !! input
1042 {|
1043 | |[ftp://|x||]" onmouseover="alert(document.cookie)">test
1044 !! result
1045 <table>
1046 <tr>
1047 <td><a href="ftp://|x||" class='external free' title="ftp://|x||" rel="nofollow">ftp://|x</td><td></a>" onmouseover="alert(document.cookie)">test
1048 </td>
1049 </tr>
1050 </table>
1051
1052 !! end
1053
1054
1055 ###
1056 ### Internal links
1057 ###
1058 !! test
1059 Plain link, capitalized
1060 !! input
1061 [[Main Page]]
1062 !! result
1063 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
1064 </p>
1065 !! end
1066
1067 !! test
1068 Plain link, uncapitalized
1069 !! input
1070 [[main Page]]
1071 !! result
1072 <p><a href="/wiki/Main_Page" title="Main Page">main Page</a>
1073 </p>
1074 !! end
1075
1076 !! test
1077 Piped link
1078 !! input
1079 [[Main Page|The Main Page]]
1080 !! result
1081 <p><a href="/wiki/Main_Page" title="Main Page">The Main Page</a>
1082 </p>
1083 !! end
1084
1085 !! test
1086 Broken link
1087 !! input
1088 [[Zigzagzogzagzig]]
1089 !! result
1090 <p><a href="/index.php?title=Zigzagzogzagzig&amp;action=edit" class="new" title="Zigzagzogzagzig">Zigzagzogzagzig</a>
1091 </p>
1092 !! end
1093
1094 !! test
1095 Link with prefix
1096 !! input
1097 xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
1098 !! result
1099 <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>
1100 </p>
1101 !! end
1102
1103 !! test
1104 Link with suffix
1105 !! input
1106 [[Main Page]]xxx, [[Main Page]]XXX
1107 !! result
1108 <p><a href="/wiki/Main_Page" title="Main Page">Main Pagexxx</a>, <a href="/wiki/Main_Page" title="Main Page">Main Page</a>XXX
1109 </p>
1110 !! end
1111
1112 !! test
1113 Link with 3 brackets
1114 !! input
1115 [[[main page]]]
1116 !! result
1117 <p>[[[main page]]]
1118 </p>
1119 !! end
1120
1121 !! test
1122 Piped link with 3 brackets
1123 !! input
1124 [[[main page|the main page]]]
1125 !! result
1126 <p>[[[main page|the main page]]]
1127 </p>
1128 !! end
1129
1130 !! test
1131 Link with multiple pipes
1132 !! input
1133 [[Main Page|The|Main|Page]]
1134 !! result
1135 <p><a href="/wiki/Main_Page" title="Main Page">The|Main|Page</a>
1136 </p>
1137 !! end
1138
1139 !! test
1140 Link to namespaces
1141 !! input
1142 [[Talk:Parser testing]], [[Meta:Disclaimers]]
1143 !! result
1144 <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>
1145 </p>
1146 !! end
1147
1148 !! test
1149 Piped link to namespace
1150 !! input
1151 [[Meta:Disclaimers|The disclaimers]]
1152 !! result
1153 <p><a href="/index.php?title=Meta:Disclaimers&amp;action=edit" class="new" title="Meta:Disclaimers">The disclaimers</a>
1154 </p>
1155 !! end
1156
1157 !! test
1158 Link containing }
1159 !! input
1160 [[Usually caused by a typo (oops}]]
1161 !! result
1162 <p>[[Usually caused by a typo (oops}]]
1163 </p>
1164 !! end
1165
1166 !! test
1167 Link containing % (not as a hex sequence)
1168 !! input
1169 [[7% Solution]]
1170 !! result
1171 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
1172 </p>
1173 !! end
1174
1175 !! test
1176 Link containing % as a single hex sequence interpreted to char
1177 !! input
1178 [[7%25 Solution]]
1179 !! result
1180 <p><a href="/index.php?title=7%25_Solution&amp;action=edit" class="new" title="7% Solution">7% Solution</a>
1181 </p>
1182 !!end
1183
1184 !! test
1185 Link containing % as a double hex sequence interpreted to hex sequence
1186 !! input
1187 [[7%2525 Solution]]
1188 !! result
1189 <p>[[7%2525 Solution]]
1190 </p>
1191 !!end
1192
1193 !! test
1194 Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
1195 Example for such a section: == < ==
1196 !! input
1197 [[%23%3c]][[%23%3e]]
1198 !! result
1199 <p><a href="#.3C" title="">#&lt;</a><a href="#.3E" title="">#&gt;</a>
1200 </p>
1201 !! end
1202
1203 !! test
1204 Link containing "<#" and ">#" as a hex sequences
1205 !! input
1206 [[%3c%23]][[%3e%23]]
1207 !! result
1208 <p>[[%3c%23]][[%3e%23]]
1209 </p>
1210 !! end
1211
1212 !! test
1213 Plain link to URL
1214 !! input
1215 [[http://www.example.org]]
1216 !! result
1217 <p>[<a href="http://www.example.org" class='external autonumber' title="http://www.example.org" rel="nofollow">[1]</a>]
1218 </p>
1219 !! end
1220
1221 # I'm fairly sure the expected result here is wrong.
1222 # We want these to be URL links, not pseudo-pages with URLs for titles....
1223 # However the current output is also pretty screwy.
1224 #
1225 # ----
1226 # I'm changing it to match the current output--it arguably makes more
1227 # sense in the light of the test above. Old expected result was:
1228 #<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>
1229 #</p>
1230 # But I think this test is bordering on "garbage in, garbage out" anyway.
1231 # -- wtm
1232 !! test
1233 Piped link to URL
1234 !! input
1235 Piped link to URL: [[http://www.example.org|an example URL]]
1236 !! result
1237 <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>]
1238 </p>
1239 !! end
1240
1241 !! test
1242 BUG 2: [[page|http://url/]] should link to page, not http://url/
1243 !! input
1244 [[Main Page|http://url/]]
1245 !! result
1246 <p><a href="/wiki/Main_Page" title="Main Page">http://url/</a>
1247 </p>
1248 !! end
1249
1250 !! test
1251 BUG 337: Escaped self-links should be bold
1252 !! options
1253 title=[[Bug462]]
1254 !! input
1255 [[Bu&#103;462]] [[Bug462]]
1256 !! result
1257 <p><strong>Bu&#103;462</strong> <strong>Bug462</strong>
1258 </p>
1259 !! end
1260
1261 !! test
1262 Self-link to section should not be bold
1263 !! options
1264 title=[[Main Page]]
1265 !! input
1266 [[Main Page#section]]
1267 !! result
1268 <p><a href="/wiki/Main_Page#section" title="Main Page">Main Page#section</a>
1269 </p>
1270 !! end
1271
1272 !! test
1273 <nowiki> inside a link
1274 !! input
1275 [[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
1276 !! result
1277 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a> <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
1278 </p>
1279 !! end
1280
1281 ###
1282 ### Interwiki links (see maintenance/interwiki.sql)
1283 ###
1284
1285 !! test
1286 Inline interwiki link
1287 !! input
1288 [[MeatBall:SoftSecurity]]
1289 !! result
1290 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class='extiw' title="meatball:SoftSecurity">MeatBall:SoftSecurity</a>
1291 </p>
1292 !! end
1293
1294 !! test
1295 Inline interwiki link with empty title (bug 2372)
1296 !! input
1297 [[MeatBall:]]
1298 !! result
1299 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class='extiw' title="meatball:">MeatBall:</a>
1300 </p>
1301 !! end
1302
1303 !! test
1304 Interwiki link encoding conversion (bug 1636)
1305 !! input
1306 *[[Wikipedia:ro:Olteni&#0355;a]]
1307 *[[Wikipedia:ro:Olteni&#355;a]]
1308 !! result
1309 <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>
1310 </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>
1311 </li></ul>
1312
1313 !! end
1314
1315 !! test
1316 Interwiki link with fragment (bug 2130)
1317 !! input
1318 [[MeatBall:SoftSecurity#foo]]
1319 !! result
1320 <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity#foo" class='extiw' title="meatball:SoftSecurity">MeatBall:SoftSecurity#foo</a>
1321 </p>
1322 !! end
1323
1324 ##
1325 ## XHTML tidiness
1326 ###
1327
1328 !! test
1329 <br> to <br />
1330 !! input
1331 1<br>2<br />3
1332 !! result
1333 <p>1<br />2<br />3
1334 </p>
1335 !! end
1336
1337 !! test
1338 Incorrecly removing closing slashes from correctly formed XHTML
1339 !! input
1340 <br style="clear:both;" />
1341 !! result
1342 <p><br style="clear:both;" />
1343 </p>
1344 !! end
1345
1346 !! test
1347 Failing to transform badly formed HTML into correct XHTML
1348 !! input
1349 <br clear=left>
1350 <br clear=right>
1351 <br clear=all>
1352 !! result
1353 <p><br clear="left" />
1354 <br clear="right" />
1355 <br clear="all" />
1356 </p>
1357 !!end
1358
1359 !! test
1360 Horizontal ruler (should it add that extra space?)
1361 !! input
1362 <hr>
1363 <hr >
1364 foo <hr
1365 > bar
1366 !! result
1367 <hr />
1368 <hr />
1369 foo <hr /> bar
1370
1371 !! end
1372
1373 ###
1374 ### Block-level elements
1375 ###
1376 !! test
1377 Common list
1378 !! input
1379 *Common list
1380 * item 2
1381 *item 3
1382 !! result
1383 <ul><li>Common list
1384 </li><li> item 2
1385 </li><li>item 3
1386 </li></ul>
1387
1388 !! end
1389
1390 !! test
1391 Numbered list
1392 !! input
1393 #Numbered list
1394 #item 2
1395 # item 3
1396 !! result
1397 <ol><li>Numbered list
1398 </li><li>item 2
1399 </li><li> item 3
1400 </li></ol>
1401
1402 !! end
1403
1404 !! test
1405 Mixed list
1406 !! input
1407 *Mixed list
1408 *# with numbers
1409 ** and bullets
1410 *# and numbers
1411 *bullets again
1412 **bullet level 2
1413 ***bullet level 3
1414 ***#Number on level 4
1415 **bullet level 2
1416 **#Number on level 3
1417 **#Number on level 3
1418 *#number level 2
1419 *Level 1
1420 !! result
1421 <ul><li>Mixed list
1422 <ol><li> with numbers
1423 </li></ol>
1424 <ul><li> and bullets
1425 </li></ul>
1426 <ol><li> and numbers
1427 </li></ol>
1428 </li><li>bullets again
1429 <ul><li>bullet level 2
1430 <ul><li>bullet level 3
1431 <ol><li>Number on level 4
1432 </li></ol>
1433 </li></ul>
1434 </li><li>bullet level 2
1435 <ol><li>Number on level 3
1436 </li><li>Number on level 3
1437 </li></ol>
1438 </li></ul>
1439 <ol><li>number level 2
1440 </li></ol>
1441 </li><li>Level 1
1442 </li></ul>
1443
1444 !! end
1445
1446 !! test
1447 List items are not parsed correctly following a <pre> block (bug 785)
1448 !! input
1449 * <pre>foo</pre>
1450 * <pre>bar</pre>
1451 * zar
1452 !! result
1453 <ul><li> <pre>foo</pre>
1454 </li><li> <pre>bar</pre>
1455 </li><li> zar
1456 </li></ul>
1457
1458 !! end
1459
1460 ###
1461 ### Magic Words
1462 ###
1463
1464 !! test
1465 Magic Word: {{CURRENTDAY}}
1466 !! input
1467 {{CURRENTDAY}}
1468 !! result
1469 <p>1
1470 </p>
1471 !! end
1472
1473 !! test
1474 Magic Word: {{CURRENTDAY2}}
1475 !! input
1476 {{CURRENTDAY2}}
1477 !! result
1478 <p>01
1479 </p>
1480 !! end
1481
1482 !! test
1483 Magic Word: {{CURRENTDAYNAME}}
1484 !! input
1485 {{CURRENTDAYNAME}}
1486 !! result
1487 <p>Thursday
1488 </p>
1489 !! end
1490
1491 !! test
1492 Magic Word: {{CURRENTDOW}}
1493 !! input
1494 {{CURRENTDOW}}
1495 !! result
1496 <p>4
1497 </p>
1498 !! end
1499
1500 !! test
1501 Magic Word: {{CURRENTMONTH}}
1502 !! input
1503 {{CURRENTMONTH}}
1504 !! result
1505 <p>01
1506 </p>
1507 !! end
1508
1509 !! test
1510 Magic Word: {{CURRENTMONTHABBREV}}
1511 !! input
1512 {{CURRENTMONTHABBREV}}
1513 !! result
1514 <p>Jan
1515 </p>
1516 !! end
1517
1518 !! test
1519 Magic Word: {{CURRENTMONTHNAME}}
1520 !! input
1521 {{CURRENTMONTHNAME}}
1522 !! result
1523 <p>January
1524 </p>
1525 !! end
1526
1527 !! test
1528 Magic Word: {{CURRENTMONTHNAMEGEN}}
1529 !! input
1530 {{CURRENTMONTHNAMEGEN}}
1531 !! result
1532 <p>January
1533 </p>
1534 !! end
1535
1536 !! test
1537 Magic Word: {{CURRENTTIME}}
1538 !! input
1539 {{CURRENTTIME}}
1540 !! result
1541 <p>00:02
1542 </p>
1543 !! end
1544
1545 !! test
1546 Magic Word: {{CURRENTWEEK}} (@bug 4594)
1547 !! input
1548 {{CURRENTWEEK}}
1549 !! result
1550 <p>1
1551 </p>
1552 !! end
1553
1554 !! test
1555 Magic Word: {{CURRENTYEAR}}
1556 !! input
1557 {{CURRENTYEAR}}
1558 !! result
1559 <p>1970
1560 </p>
1561 !! end
1562
1563 !! test
1564 Magic Word: {{FULLPAGENAME}}
1565 !! options
1566 title=[[User:Ævar Arnfjörð Bjarmason]]
1567 !! input
1568 {{FULLPAGENAME}}
1569 !! result
1570 <p>User:Ævar Arnfjörð Bjarmason
1571 </p>
1572 !! end
1573
1574 !! test
1575 Magic Word: {{FULLPAGENAMEE}}
1576 !! options
1577 title=[[User:Ævar Arnfjörð Bjarmason]]
1578 !! input
1579 {{FULLPAGENAMEE}}
1580 !! result
1581 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
1582 </p>
1583 !! end
1584
1585 !! test
1586 Magic Word: {{NAMESPACE}}
1587 !! options
1588 title=[[User:Ævar Arnfjörð Bjarmason]]
1589 disabled # FIXME
1590 !! input
1591 {{NAMESPACE}}
1592 !! result
1593 <p>User
1594 </p>
1595 !! end
1596
1597 !! test
1598 Magic Word: {{NAMESPACEE}}
1599 !! options
1600 title=[[User:Ævar Arnfjörð Bjarmason]]
1601 disabled # FIXME
1602 !! input
1603 {{NAMESPACEE}}
1604 !! result
1605 <p>User
1606 </p>
1607 !! end
1608
1609 !! test
1610 Magic Word: {{NUMBEROFARTICLES}}
1611 !! input
1612 {{NUMBEROFARTICLES}}
1613 !! result
1614 <p>-1
1615 </p>
1616 !! end
1617
1618 !! test
1619 Magic Word: {{NUMBEROFFILES}}
1620 !! input
1621 {{NUMBEROFFILES}}
1622 !! result
1623 <p>1
1624 </p>
1625 !! end
1626
1627 !! test
1628 Magic Word: {{PAGENAME}}
1629 !! options
1630 title=[[User:Ævar Arnfjörð Bjarmason]]
1631 disabled # FIXME
1632 !! input
1633 {{PAGENAME}}
1634 !! result
1635 <p>Ævar Arnfjörð Bjarmason
1636 </p>
1637 !! end
1638
1639 !! test
1640 Magic Word: {{PAGENAMEE}}
1641 !! options
1642 title=[[User:Ævar Arnfjörð Bjarmason]]
1643 !! input
1644 {{PAGENAMEE}}
1645 !! result
1646 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
1647 </p>
1648 !! end
1649
1650 !! test
1651 Magic Word: {{REVISIONID}}
1652 !! input
1653 {{REVISIONID}}
1654 !! result
1655 <p>1337
1656 </p>
1657 !! end
1658
1659 !! test
1660 Magic Word: {{SCRIPTPATH}}
1661 !! input
1662 {{SCRIPTPATH}}
1663 !! result
1664 <p>/
1665 </p>
1666 !! end
1667
1668 !! test
1669 Magic Word: {{SERVER}}
1670 !! input
1671 {{SERVER}}
1672 !! result
1673 <p><a href="http://localhost" class='external free' title="http://localhost" rel="nofollow">http://localhost</a>
1674 </p>
1675 !! end
1676
1677 !! test
1678 Magic Word: {{SERVERNAME}}
1679 !! input
1680 {{SERVERNAME}}
1681 !! result
1682 <p>Britney Spears
1683 </p>
1684 !! end
1685
1686 !! test
1687 Magic Word: {{SITENAME}}
1688 !! input
1689 {{SITENAME}}
1690 !! result
1691 <p>MediaWiki
1692 </p>
1693 !! end
1694
1695 !! test
1696 Namespace 1 {{ns:1}}
1697 !! input
1698 {{ns:1}}
1699 !! result
1700 <p>Talk
1701 </p>
1702 !! end
1703
1704 !! test
1705 Namespace 1 {{ns:01}}
1706 !! input
1707 {{ns:01}}
1708 !! result
1709 <p>Talk
1710 </p>
1711 !! end
1712
1713 !! test
1714 Namespace 0 {{ns:0}} (bug 4783)
1715 !! input
1716 {{ns:0}}
1717 !! result
1718
1719 !! end
1720
1721 !! test
1722 Namespace 0 {{ns:00}} (bug 4783)
1723 !! input
1724 {{ns:00}}
1725 !! result
1726
1727 !! end
1728
1729 !! test
1730 Namespace -1 {{ns:-1}}
1731 !! input
1732 {{ns:-1}}
1733 !! result
1734 <p>Special
1735 </p>
1736 !! end
1737
1738 !! test
1739 Namespace Project {{ns:User}}
1740 !! input
1741 {{ns:User}}
1742 !! result
1743 <p>User
1744 </p>
1745 !! end
1746
1747
1748 ###
1749 ### Magic links
1750 ###
1751 !! test
1752 Magic links: internal link to RFC (bug 479)
1753 !! input
1754 [[RFC 123]]
1755 !! result
1756 <p><a href="/index.php?title=RFC_123&amp;action=edit" class="new" title="RFC 123">RFC 123</a>
1757 </p>
1758 !! end
1759
1760 !! test
1761 Magic links: RFC (bug 479)
1762 !! input
1763 RFC 822
1764 !! result
1765 <p><a href='http://www.ietf.org/rfc/rfc822.txt' class='external' title="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>
1766 </p>
1767 !! end
1768
1769 !! test
1770 Magic links: ISBN (bug 1937)
1771 !! input
1772 ISBN 0-306-40615-2
1773 !! result
1774 <p><a href="/index.php?title=Special:Booksources&amp;isbn=0306406152" class="internal">ISBN 0-306-40615-2</a>
1775 </p>
1776 !! end
1777
1778 !! test
1779 Magic links: PMID incorrectly converts space to underscore
1780 !! input
1781 PMID 1234
1782 !! result
1783 <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>
1784 </p>
1785 !! end
1786
1787 ###
1788 ### Templates
1789 ####
1790
1791 !! test
1792 Nonexistant template
1793 !! input
1794 {{thistemplatedoesnotexist}}
1795 !! result
1796 <p><a href="/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit" class="new" title="Template:Thistemplatedoesnotexist">Template:Thistemplatedoesnotexist</a>
1797 </p>
1798 !! end
1799
1800 !! article
1801 Template:test
1802 !! text
1803 This is a test template
1804 !! endarticle
1805
1806 !! test
1807 Simple template
1808 !! input
1809 {{test}}
1810 !! result
1811 <p>This is a test template
1812 </p>
1813 !! end
1814
1815 !! test
1816 Template with explicit namespace
1817 !! input
1818 {{Template:test}}
1819 !! result
1820 <p>This is a test template
1821 </p>
1822 !! end
1823
1824
1825 !! article
1826 Template:paramtest
1827 !! text
1828 This is a test template with parameter {{{param}}}
1829 !! endarticle
1830
1831 !! test
1832 Template parameter
1833 !! input
1834 {{paramtest|param=foo}}
1835 !! result
1836 <p>This is a test template with parameter foo
1837 </p>
1838 !! end
1839
1840 !! article
1841 Template:paramtestnum
1842 !! text
1843 [[{{{1}}}|{{{2}}}]]
1844 !! endarticle
1845
1846 !! test
1847 Template unnamed parameter
1848 !! input
1849 {{paramtestnum|Main Page|the main page}}
1850 !! result
1851 <p><a href="/wiki/Main_Page" title="Main Page">the main page</a>
1852 </p>
1853 !! end
1854
1855 !! article
1856 Template:templatesimple
1857 !! text
1858 (test)
1859 !! endarticle
1860
1861 !! article
1862 Template:templateredirect
1863 !! text
1864 #redirect [[Template:templatesimple]]
1865 !! endarticle
1866
1867 !! article
1868 Template:templateasargtestnum
1869 !! text
1870 {{{{{1}}}}}
1871 !! endarticle
1872
1873 !! article
1874 Template:templateasargtest
1875 !! text
1876 {{template{{{templ}}}}}
1877 !! endarticle
1878
1879 !! article
1880 Template:templateasargtest2
1881 !! text
1882 {{{{{templ}}}}}
1883 !! endarticle
1884
1885 !! test
1886 Template with template name as unnamed argument
1887 !! input
1888 {{templateasargtestnum|templatesimple}}
1889 !! result
1890 <p>(test)
1891 </p>
1892 !! end
1893
1894 !! test
1895 Template with template name as argument
1896 !! input
1897 {{templateasargtest|templ=simple}}
1898 !! result
1899 <p>(test)
1900 </p>
1901 !! end
1902
1903 !! test
1904 Template with template name as argument (2)
1905 !! input
1906 {{templateasargtest2|templ=templatesimple}}
1907 !! result
1908 <p>(test)
1909 </p>
1910 !! end
1911
1912 !! article
1913 Template:templateasargtestdefault
1914 !! text
1915 {{{{{templ|templatesimple}}}}}
1916 !! endarticle
1917
1918 !! article
1919 Template:templa
1920 !! text
1921 '''templ'''
1922 !! endarticle
1923
1924 !! test
1925 Template with default value
1926 !! input
1927 {{templateasargtestdefault}}
1928 !! result
1929 <p>(test)
1930 </p>
1931 !! end
1932
1933 !! test
1934 Template with default value (value set)
1935 !! input
1936 {{templateasargtestdefault|templ=templa}}
1937 !! result
1938 <p><b>templ</b>
1939 </p>
1940 !! end
1941
1942 !! test
1943 Template redirect
1944 !! input
1945 {{templateredirect}}
1946 !! result
1947 <p>(test)
1948 </p>
1949 !! end
1950
1951 !! test
1952 Template with argument in separate line
1953 !! input
1954 {{ templateasargtest |
1955 templ = simple }}
1956 !! result
1957 <p>(test)
1958 </p>
1959 !! end
1960
1961 !! test
1962 Template with complex template as argument
1963 !! input
1964 {{paramtest|
1965 param ={{ templateasargtest |
1966 templ = simple }}}}
1967 !! result
1968 <p>This is a test template with parameter (test)
1969 </p>
1970 !! end
1971
1972 !! test
1973 Template with thumb image (wiht link in description)
1974 !! input
1975 {{paramtest|
1976 param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
1977 !! result
1978 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>
1979
1980 !! end
1981
1982 !! article
1983 Template:complextemplate
1984 !! text
1985 {{{1}}} {{paramtest|
1986 param ={{{param}}}}}
1987 !! endarticle
1988
1989 !! test
1990 Template with complex arguments
1991 !! input
1992 {{complextemplate|
1993 param ={{ templateasargtest |
1994 templ = simple }}|[[Template:complextemplate|link]]}}
1995 !! result
1996 <p><a href="/wiki/Template:Complextemplate" title="Template:Complextemplate">link</a> This is a test template with parameter (test)
1997 </p>
1998 !! end
1999
2000 !! test
2001 BUG 553: link with two variables in a piped link
2002 !! input
2003 {|
2004 |[[{{{1}}}|{{{2}}}]]
2005 |}
2006 !! result
2007 <table>
2008 <tr>
2009 <td>[[{{{1}}}|{{{2}}}]]
2010 </td></tr></table>
2011
2012 !! end
2013
2014 !! test
2015 Magic variable as template parameter
2016 !! input
2017 {{paramtest|param={{SITENAME}}}}
2018 !! result
2019 <p>This is a test template with parameter MediaWiki
2020 </p>
2021 !! end
2022
2023 !! article
2024 Template:linktest
2025 !! text
2026 [[{{{param}}}|link]]
2027 !! endarticle
2028
2029 !! test
2030 Template parameter as link source
2031 !! input
2032 {{linktest|param=Main Page}}
2033 !! result
2034 <p><a href="/wiki/Main_Page" title="Main Page">link</a>
2035 </p>
2036 !! end
2037
2038
2039 !!article
2040 Template:paramtest2
2041 !! text
2042 including another template, {{paramtest|param={{{arg}}}}}
2043 !! endarticle
2044
2045 !! test
2046 Template passing argument to another template
2047 !! input
2048 {{paramtest2|arg='hmm'}}
2049 !! result
2050 <p>including another template, This is a test template with parameter 'hmm'
2051 </p>
2052 !! end
2053
2054 !! article
2055 Template:Linktest2
2056 !! text
2057 Main Page
2058 !! endarticle
2059
2060 !! test
2061 Template as link source
2062 !! input
2063 [[{{linktest2}}]]
2064 !! result
2065 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>
2066 </p>
2067 !! end
2068
2069
2070 !! article
2071 Template:loop1
2072 !! text
2073 {{loop2}}
2074 !! endarticle
2075
2076 !! article
2077 Template:loop2
2078 !! text
2079 {{loop1}}
2080 !! endarticle
2081
2082 !! test
2083 Template infinite loop
2084 !! input
2085 {{loop1}}
2086 !! result
2087 <p>{{loop1}}<!-- WARNING: template loop detected -->
2088 </p>
2089 !! end
2090
2091 !! test
2092 Template from main namespace
2093 !! input
2094 {{:Main Page}}
2095 !! result
2096 <p>blah blah
2097 </p>
2098 !! end
2099
2100 !! article
2101 Template:table
2102 !! text
2103 {|
2104 | 1 || 2
2105 |-
2106 | 3 || 4
2107 |}
2108 !! endarticle
2109
2110 !! test
2111 BUG 529: Template with table, not included at beginning of line
2112 !! input
2113 foo {{table}}
2114 !! result
2115 <p>foo
2116 </p>
2117 <table>
2118 <tr>
2119 <td> 1 </td><td> 2
2120 </td></tr>
2121 <tr>
2122 <td> 3 </td><td> 4
2123 </td></tr></table>
2124
2125 !! end
2126
2127 !! test
2128 BUG 523: Template shouldn't eat newline (or add an extra one before table)
2129 !! input
2130 foo
2131 {{table}}
2132 !! result
2133 <p>foo
2134 </p>
2135 <table>
2136 <tr>
2137 <td> 1 </td><td> 2
2138 </td></tr>
2139 <tr>
2140 <td> 3 </td><td> 4
2141 </td></tr></table>
2142
2143 !! end
2144
2145 !! test
2146 BUG 41: Template parameters shown as broken links
2147 !! input
2148 {{{parameter}}}
2149 !! result
2150 <p>{{{parameter}}}
2151 </p>
2152 !! end
2153
2154
2155 !! article
2156 Template:MSGNW test
2157 !! text
2158 ''None'' of '''this''' should be
2159 * interepreted
2160 but rather passed unmodified
2161 {{test}}
2162 !! endarticle
2163
2164 # hmm, fix this or just deprecate msgnw and document its behavior?
2165 !! test
2166 msgnw keyword
2167 !! options
2168 disabled
2169 !! input
2170 {{msgnw:MSGNW test}}
2171 !! result
2172 <p>''None'' of '''this''' should be
2173 * interepreted
2174 but rather passed unmodified
2175 {{test}}
2176 </p>
2177 !! end
2178
2179 !! test
2180 int keyword
2181 !! input
2182 {{int:youhavenewmessages|lots of money|not!}}
2183 !! result
2184 <p>You have lots of money (not!).
2185 </p>
2186 !! end
2187
2188 !! article
2189 Template:Includes
2190 !! text
2191 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
2192 !! endarticle
2193
2194 !! test
2195 <includeonly> and <noinclude> being included
2196 !! input
2197 {{Includes}}
2198 !! result
2199 <p>Foobar
2200 </p>
2201 !! end
2202
2203 !! article
2204 Template:Includes2
2205 !! text
2206 <onlyinclude>Foo</onlyinclude>bar
2207 !! endarticle
2208
2209 !! test
2210 <onlyinclude> being included
2211 !! input
2212 {{Includes2}}
2213 !! result
2214 <p>Foo
2215 </p>
2216 !! end
2217
2218
2219 !! article
2220 Template:Includes3
2221 !! text
2222 <onlyinclude>Foo</onlyinclude>bar<includeonly>zar</includeonly>
2223 !! endarticle
2224
2225 !! test
2226 <onlyinclude> and <includeonly> being included
2227 !! input
2228 {{Includes3}}
2229 !! result
2230 <p>Foo
2231 </p>
2232 !! end
2233
2234 !! test
2235 <includeonly> and <noinclude> on a page
2236 !! input
2237 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
2238 !! result
2239 <p>Foozar
2240 </p>
2241 !! end
2242
2243 !! test
2244 <onlyinclude> on a page
2245 !! input
2246 <onlyinclude>Foo</onlyinclude>bar
2247 !! result
2248 <p>Foobar
2249 </p>
2250 !! end
2251
2252 ###
2253 ### Pre-save transform tests
2254 ###
2255 !! test
2256 pre-save transform: subst:
2257 !! options
2258 PST
2259 !! input
2260 {{subst:test}}
2261 !! result
2262 This is a test template
2263 !! end
2264
2265 !! test
2266 pre-save transform: normal template
2267 !! options
2268 PST
2269 !! input
2270 {{test}}
2271 !! result
2272 {{test}}
2273 !! end
2274
2275 !! test
2276 pre-save transform: nonexistant template
2277 !! options
2278 PST
2279 !! input
2280 {{thistemplatedoesnotexist}}
2281 !! result
2282 {{thistemplatedoesnotexist}}
2283 !! end
2284
2285
2286 !! test
2287 pre-save transform: subst magic variables
2288 !! options
2289 PST
2290 !! input
2291 {{subst:SITENAME}}
2292 !! result
2293 MediaWiki
2294 !! end
2295
2296 # This is bug 89, which I fixed. -- wtm
2297 !! test
2298 pre-save transform: subst: templates with parameters
2299 !! options
2300 pst
2301 !! input
2302 {{subst:paramtest|param="something else"}}
2303 !! result
2304 This is a test template with parameter "something else"
2305 !! end
2306
2307 !! article
2308 Template:nowikitest
2309 !! text
2310 <nowiki>'''not wiki'''</nowiki>
2311 !! endarticle
2312
2313 !! test
2314 pre-save transform: nowiki in subst (bug 1188)
2315 !! options
2316 pst
2317 !! input
2318 {{subst:nowikitest}}
2319 !! result
2320 <nowiki>'''not wiki'''</nowiki>
2321 !! end
2322
2323
2324 !! article
2325 Template:commenttest
2326 !! text
2327 This template has <!-- a comment --> in it.
2328 !! endarticle
2329
2330 !! test
2331 pre-save transform: comment in subst (bug 1936)
2332 !! options
2333 pst
2334 !! input
2335 {{subst:commenttest}}
2336 !! result
2337 This template has <!-- a comment --> in it.
2338 !! end
2339
2340
2341 !! article
2342 Template:dangerous
2343 !!text
2344 <span onmouseover="alert('crap')">Oh no</span>
2345 !!endarticle
2346
2347 !!test
2348 (confirming safety of fix for subst bug 1936)
2349 !! input
2350 {{Template:dangerous}}
2351 !! result
2352 <p><span>Oh no</span>
2353 </p>
2354 !! end
2355
2356 !! test
2357 pre-save transform: comment containing gallery (bug 5024)
2358 !! options
2359 pst
2360 !! input
2361 <!-- <gallery>data</gallery> -->
2362 !!result
2363 <!-- <gallery>data</gallery> -->
2364 !!end
2365
2366 !! test
2367 pre-save transform: comment containing extension
2368 !! options
2369 pst
2370 !! input
2371 <!-- <tag>data</tag> -->
2372 !!result
2373 <!-- <tag>data</tag> -->
2374 !!end
2375
2376 !! test
2377 pre-save transform: comment containing nowiki
2378 !! options
2379 pst
2380 !! input
2381 <!-- <nowiki>data</nowiki> -->
2382 !!result
2383 <!-- <nowiki>data</nowiki> -->
2384 !!end
2385
2386 !! test
2387 pre-save transform: comment containing math
2388 !! options
2389 pst
2390 !! input
2391 <!-- <math>data</math> -->
2392 !!result
2393 <!-- <math>data</math> -->
2394 !!end
2395
2396
2397 ###
2398 ### Message transform tests
2399 ###
2400 !! test
2401 message transform: magic variables
2402 !! options
2403 msg
2404 !! input
2405 {{SITENAME}}
2406 !! result
2407 MediaWiki
2408 !! end
2409
2410 !! test
2411 message transform: should not transform wiki markup
2412 !! options
2413 msg
2414 !! input
2415 ''test''
2416 !! result
2417 ''test''
2418 !! end
2419
2420 ###
2421 ### Images
2422 ###
2423 !! test
2424 Simple image
2425 !! input
2426 [[Image:foobar.jpg]]
2427 !! result
2428 <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>
2429 </p>
2430 !! end
2431
2432 !! test
2433 Right-aligned image
2434 !! input
2435 [[Image:foobar.jpg|right]]
2436 !! result
2437 <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>
2438
2439 !! end
2440
2441 !! test
2442 Image with caption
2443 !! input
2444 [[Image:foobar.jpg|right|Caption text]]
2445 !! result
2446 <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>
2447
2448 !! end
2449
2450 !! test
2451 Image with frame and link
2452 !! input
2453 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
2454 !! result
2455 <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>
2456
2457 !! end
2458
2459 !! test
2460 Link to image page- image page normally doesn't exists, hence edit link
2461 TODO: Add test with existing image page
2462 #<p><a href="/wiki/Image:Test" title="Image:Test">Image:test</a>
2463 !! input
2464 [[:Image:test]]
2465 !! result
2466 <p><a href="/index.php?title=Image:Test&amp;action=edit" class="new" title="Image:Test">Image:test</a>
2467 </p>
2468 !! end
2469
2470 !! test
2471 Frameless image caption with a free URL
2472 !! input
2473 [[Image:foobar.jpg|http://example.com]]
2474 !! result
2475 <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>
2476 </p>
2477 !! end
2478
2479 !! test
2480 Thumbnail image caption with a free URL
2481 !! input
2482 [[Image:foobar.jpg|thumb|http://example.com]]
2483 !! result
2484 <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>
2485
2486 !! end
2487
2488 !! test
2489 BUG 1887: A ISBN with a thumbnail
2490 !! input
2491 [[Image:foobar.jpg|thumb|ISBN 12354]]
2492 !! result
2493 <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>
2494
2495 !! end
2496
2497 !! test
2498 BUG 1887: A RFC with a thumbnail
2499 !! input
2500 [[Image:foobar.jpg|thumb|This is RFC 12354]]
2501 !! result
2502 <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>
2503
2504 !! end
2505
2506 !! test
2507 BUG 1887: A mailto link with a thumbnail
2508 !! input
2509 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
2510 !! result
2511 <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>
2512
2513 !! end
2514
2515 !! test
2516 BUG 1887: A <math> with a thumbnail- we don't render math in the parsertests by default,
2517 so math is not stripped and turns up as escaped &lt;math&gt; tags.
2518 !! input
2519 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
2520 !! result
2521 <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>
2522
2523 !! end
2524
2525 !! test
2526 BUG 1887, part 2: A <math> with a thumbnail- math enabled
2527 !! options
2528 math
2529 !! input
2530 [[Image:foobar.jpg|thumb|<math>2+2</math>]]
2531 !! result
2532 <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>
2533
2534 !! end
2535
2536 # Pending resolution to bug 368
2537 !! test
2538 BUG 648: Frameless image caption with a link
2539 !! input
2540 [[Image:foobar.jpg|text with a [[link]] in it]]
2541 !! result
2542 <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>
2543 </p>
2544 !! end
2545
2546 !! test
2547 BUG 648: Frameless image caption with a link (suffix)
2548 !! input
2549 [[Image:foobar.jpg|text with a [[link]]foo in it]]
2550 !! result
2551 <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>
2552 </p>
2553 !! end
2554
2555 !! test
2556 BUG 648: Frameless image caption with an interwiki link
2557 !! input
2558 [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]]
2559 !! result
2560 <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>
2561 </p>
2562 !! end
2563
2564 !! test
2565 BUG 648: Frameless image caption with a piped interwiki link
2566 !! input
2567 [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
2568 !! result
2569 <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>
2570 </p>
2571 !! end
2572
2573 !! test
2574 Escape HTML special chars in image alt text
2575 !! input
2576 [[Image:foobar.jpg|& < > "]]
2577 !! result
2578 <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>
2579 </p>
2580 !! end
2581
2582 !! test
2583 BUG 499: Alt text should have &#1234;, not &amp;1234;
2584 !! input
2585 [[Image:foobar.jpg|&#9792;]]
2586 !! result
2587 <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>
2588 </p>
2589 !! end
2590
2591 !! test
2592 Broken image caption with link
2593 !! input
2594 [[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link.
2595 !! result
2596 <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.
2597 </p>
2598 !! end
2599
2600 !! test
2601 Image caption containing another image
2602 !! input
2603 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
2604 !! result
2605 <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>
2606
2607 !! end
2608
2609 !! test
2610 Image caption containing a newline
2611 !! input
2612 [[Image:Foobar.jpg|This
2613 *is some text]]
2614 !! result
2615 <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>
2616 </p>
2617 !!end
2618
2619
2620 !! test
2621 Bug 3090: External links other than http: in image captions
2622 !! input
2623 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
2624 !! result
2625 <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>
2626
2627 !! end
2628
2629
2630 ###
2631 ### Subpages
2632 ###
2633 !! article
2634 Subpage test/subpage
2635 !! text
2636 foo
2637 !! endarticle
2638
2639 !! test
2640 Subpage link
2641 !! options
2642 subpage title=[[Subpage test]]
2643 !! input
2644 [[/subpage]]
2645 !! result
2646 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">/subpage</a>
2647 </p>
2648 !! end
2649
2650 !! test
2651 Subpage noslash link
2652 !! options
2653 subpage title=[[Subpage test]]
2654 !!input
2655 [[/subpage/]]
2656 !! result
2657 <p><a href="/wiki/Subpage_test/subpage" title="Subpage test/subpage">subpage</a>
2658 </p>
2659 !! end
2660
2661 !! test
2662 Disabled subpages
2663 !! input
2664 [[/subpage]]
2665 !! result
2666 <p><a href="/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
2667 </p>
2668 !! end
2669
2670 !! test
2671 BUG 561: {{/Subpage}}
2672 !! options
2673 subpage title=[[Page]]
2674 !! input
2675 {{/Subpage}}
2676 !! result
2677 <p><a href="/index.php?title=Page/Subpage&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
2678 </p>
2679 !! end
2680
2681 ###
2682 ### Categories
2683 ###
2684 !! article
2685 Category:MediaWiki User's Guide
2686 !! text
2687 blah
2688 !! endarticle
2689
2690 !! test
2691 Link to category
2692 !! input
2693 [[:Category:MediaWiki User's Guide]]
2694 !! result
2695 <p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
2696 </p>
2697 !! end
2698
2699 !! test
2700 Simple category
2701 !! options
2702 cat
2703 !! input
2704 [[Category:MediaWiki User's Guide]]
2705 !! result
2706 <a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
2707 !! end
2708
2709 ###
2710 ### Inter-language links
2711 ###
2712 !! test
2713 Inter-language links
2714 !! options
2715 ill
2716 !! input
2717 [[es:Alimento]]
2718 [[fr:Nourriture]]
2719 [[zh:&#39135;&#21697;]]
2720 !! result
2721 es:Alimento fr:Nourriture zh:食品
2722 !! end
2723
2724 ###
2725 ### Sections
2726 ###
2727 !! test
2728 Basic section headings
2729 !! options
2730 title=[[Parser test script]]
2731 !! input
2732 == Headline 1 ==
2733 Some text
2734
2735 ==Headline 2==
2736 More
2737 ===Smaller headline===
2738 Blah blah
2739 !! result
2740 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
2741 <p>Some text
2742 </p>
2743 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</div><a name="Headline_2"></a><h2>Headline 2</h2>
2744 <p>More
2745 </p>
2746 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</div><a name="Smaller_headline"></a><h3>Smaller headline</h3>
2747 <p>Blah blah
2748 </p>
2749 !! end
2750
2751 !! test
2752 Section headings with TOC
2753 !! options
2754 title=[[Parser test script]]
2755 !! input
2756 == Headline 1 ==
2757 === Subheadline 1 ===
2758 ===== Skipping a level =====
2759 ====== Skipping a level ======
2760
2761 == Headline 2 ==
2762 Some text
2763 ===Another headline===
2764 !! result
2765 <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
2766 <ul>
2767 <li class='toclevel-1'><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
2768 <ul>
2769 <li class='toclevel-2'><a href="#Subheadline_1"><span class="tocnumber">1.1</span> <span class="toctext">Subheadline 1</span></a>
2770 <ul>
2771 <li class='toclevel-3'><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
2772 <ul>
2773 <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>
2774 </ul>
2775 </li>
2776 </ul>
2777 </li>
2778 </ul>
2779 </li>
2780 <li class='toclevel-1'><a href="#Headline_2"><span class="tocnumber">2</span> <span class="toctext">Headline 2</span></a>
2781 <ul>
2782 <li class='toclevel-2'><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
2783 </ul>
2784 </li>
2785 </ul>
2786 </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
2787 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
2788 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</div><a name="Subheadline_1"></a><h3> Subheadline 1 </h3>
2789 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</div><a name="Skipping_a_level"></a><h5> Skipping a level </h5>
2790 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</div><a name="Skipping_a_level_2"></a><h6> Skipping a level </h6>
2791 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</div><a name="Headline_2"></a><h2> Headline 2 </h2>
2792 <p>Some text
2793 </p>
2794 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</div><a name="Another_headline"></a><h3>Another headline</h3>
2795
2796 !! end
2797
2798 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
2799 !! test
2800 Handling of sections up to level 6 and beyond
2801 !! input
2802 = Level 1 Heading=
2803 == Level 2 Heading==
2804 === Level 3 Heading===
2805 ==== Level 4 Heading====
2806 ===== Level 5 Heading=====
2807 ====== Level 6 Heading======
2808 ======= Level 7 Heading=======
2809 ======== Level 8 Heading========
2810 ========= Level 9 Heading=========
2811 ========== Level 10 Heading==========
2812 !! result
2813 <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
2814 <ul>
2815 <li class='toclevel-1'><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
2816 <ul>
2817 <li class='toclevel-2'><a href="#Level_2_Heading"><span class="tocnumber">1.1</span> <span class="toctext">Level 2 Heading</span></a>
2818 <ul>
2819 <li class='toclevel-3'><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
2820 <ul>
2821 <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>
2822 <ul>
2823 <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>
2824 <ul>
2825 <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>
2826 <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>
2827 <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>
2828 <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>
2829 <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>
2830 </ul>
2831 </li>
2832 </ul>
2833 </li>
2834 </ul>
2835 </li>
2836 </ul>
2837 </li>
2838 </ul>
2839 </li>
2840 </ul>
2841 </td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
2842 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</div><a name="Level_1_Heading"></a><h1> Level 1 Heading</h1>
2843 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</div><a name="Level_2_Heading"></a><h2> Level 2 Heading</h2>
2844 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</div><a name="Level_3_Heading"></a><h3> Level 3 Heading</h3>
2845 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</div><a name="Level_4_Heading"></a><h4> Level 4 Heading</h4>
2846 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</div><a name="Level_5_Heading"></a><h5> Level 5 Heading</h5>
2847 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</div><a name="Level_6_Heading"></a><h6> Level 6 Heading</h6>
2848 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</div><a name=".3D_Level_7_Heading.3D"></a><h6>= Level 7 Heading=</h6>
2849 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</div><a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6>== Level 8 Heading==</h6>
2850 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</div><a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6>=== Level 9 Heading===</h6>
2851 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</div><a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6>==== Level 10 Heading====</h6>
2852
2853 !! end
2854
2855 !! test
2856 Resolving duplicate section names
2857 !! options
2858 title=[[Parser test script]]
2859 !! input
2860 == Foo bar ==
2861 == Foo bar ==
2862 !! result
2863 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</div><a name="Foo_bar"></a><h2> Foo bar </h2>
2864 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</div><a name="Foo_bar_2"></a><h2> Foo bar </h2>
2865
2866 !! end
2867
2868 !! article
2869 Template:sections
2870 !! text
2871 ===Section 1===
2872 ==Section 2==
2873 !! endarticle
2874
2875 !! test
2876 Template with sections, __NOTOC__
2877 !! options
2878 title=[[Parser test script]]
2879 !! input
2880 __NOTOC__
2881 ==Section 0==
2882 {{sections}}
2883 ==Section 4==
2884 !! result
2885 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
2886 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
2887 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
2888 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
2889
2890 !! end
2891
2892 !! test
2893 __NOEDITSECTION__ keyword
2894 !! input
2895 __NOEDITSECTION__
2896 ==Section 1==
2897 ==Section 2==
2898 !! result
2899 <a name="Section_1"></a><h2>Section 1</h2>
2900 <a name="Section_2"></a><h2>Section 2</h2>
2901
2902 !! end
2903
2904 !! test
2905 Link inside a section heading
2906 !! options
2907 title=[[Parser test script]]
2908 !! input
2909 ==Section with a [[Main Page|link]] in it==
2910 !! result
2911 <div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</div><a name="Section_with_a_link_in_it"></a><h2>Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</h2>
2912
2913 !! end
2914
2915
2916 !! test
2917 BUG 1219 URL next to image (good)
2918 !! input
2919 http://example.com [[Image:foobar.jpg]]
2920 !! result
2921 <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>
2922 </p>
2923 !!end
2924
2925 !! test
2926 BUG 1219 URL next to image (broken)
2927 !! input
2928 http://example.com[[Image:foobar.jpg]]
2929 !! result
2930 <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>
2931 </p>
2932 !!end
2933
2934 !! test
2935 Bug 1186 news: in the middle of text
2936 !! input
2937 http://en.wikinews.org/wiki/Wikinews:Workplace
2938 !! result
2939 <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>
2940 </p>
2941 !!end
2942
2943
2944 !! test
2945 Namespaced link must have a title
2946 !! input
2947 [[Project:]]
2948 !! result
2949 <p>[[Project:]]
2950 </p>
2951 !!end
2952
2953 !! test
2954 Namespaced link must have a title (bad fragment version)
2955 !! input
2956 [[Project:#fragment]]
2957 !! result
2958 <p>[[Project:#fragment]]
2959 </p>
2960 !!end
2961
2962
2963 !! test
2964 div with no attributes
2965 !! input
2966 <div>HTML rocks</div>
2967 !! result
2968 <div>HTML rocks</div>
2969
2970 !! end
2971
2972 !! test
2973 div with double-quoted attribute
2974 !! input
2975 <div id="rock">HTML rocks</div>
2976 !! result
2977 <div id="rock">HTML rocks</div>
2978
2979 !! end
2980
2981 !! test
2982 div with single-quoted attribute
2983 !! input
2984 <div id='rock'>HTML rocks</div>
2985 !! result
2986 <div id="rock">HTML rocks</div>
2987
2988 !! end
2989
2990 !! test
2991 div with unquoted attribute
2992 !! input
2993 <div id=rock>HTML rocks</div>
2994 !! result
2995 <div id="rock">HTML rocks</div>
2996
2997 !! end
2998
2999 !! test
3000 div with illegal double attributes
3001 !! input
3002 <div align="center" align="right">HTML rocks</div>
3003 !! result
3004 <div align="right">HTML rocks</div>
3005
3006 !!end
3007
3008 !! test
3009 HTML multiple attributes correction
3010 !! input
3011 <p class="error" class="awesome">Awesome!</p>
3012 !! result
3013 <p class="awesome">Awesome!</p>
3014
3015 !!end
3016
3017 !! test
3018 Table multiple attributes correction
3019 !! input
3020 {|
3021 !+ class="error" class="awesome"| status
3022 |}
3023 !! result
3024 <table>
3025 <tr>
3026 <th class="awesome"> status
3027 </th></tr></table>
3028
3029 !!end
3030
3031 !! test
3032 DIV IN UPPERCASE
3033 !! input
3034 <DIV ALIGN="center">HTML ROCKS</DIV>
3035 !! result
3036 <div align="center">HTML ROCKS</div>
3037
3038 !!end
3039
3040
3041 !! test
3042 text with amp in the middle of nowhere
3043 !! input
3044 Remember AT&T?
3045 !!result
3046 <p>Remember AT&amp;T?
3047 </p>
3048 !! end
3049
3050 !! test
3051 text with character entity: eacute
3052 !! input
3053 I always thought &eacute; was a cute letter.
3054 !! result
3055 <p>I always thought &eacute; was a cute letter.
3056 </p>
3057 !! end
3058
3059 !! test
3060 text with undefined character entity: xacute
3061 !! input
3062 I always thought &xacute; was a cute letter.
3063 !! result
3064 <p>I always thought &amp;xacute; was a cute letter.
3065 </p>
3066 !! end
3067
3068
3069 ###
3070 ### Media links
3071 ###
3072
3073 !! test
3074 Media link
3075 !! input
3076 [[Media:Foobar.jpg]]
3077 !! result
3078 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class='internal' title="Foobar.jpg">Media:Foobar.jpg</a>
3079 </p>
3080 !! end
3081
3082 !! test
3083 Media link with text
3084 !! input
3085 [[Media:Foobar.jpg|A neat file to look at]]
3086 !! result
3087 <p><a href="http://example.com/images/3/3a/Foobar.jpg" class='internal' title="Foobar.jpg">A neat file to look at</a>
3088 </p>
3089 !! end
3090
3091 # FIXME: this is still bad HTML tag nesting
3092 !! test
3093 Media link with nasty text
3094 fixme: doBlockLevels won't wrap this in a paragraph because it contains a div
3095 !! input
3096 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
3097 !! result
3098 <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>
3099
3100 !! end
3101
3102 !! test
3103 Media link to nonexistent file (bug 1702)
3104 !! input
3105 [[Media:No such.jpg]]
3106 !! result
3107 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class='new' title="No such.jpg">Media:No such.jpg</a>
3108 </p>
3109 !! end
3110
3111 !! test
3112 Image link to nonexistent file (bug 1850 - good)
3113 !! input
3114 [[Image:No such.jpg]]
3115 !! result
3116 <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>
3117 </p>
3118 !! end
3119
3120 !! test
3121 :Image link to nonexistent file (bug 1850 - bad)
3122 !! input
3123 [[:Image:No such.jpg]]
3124 !! result
3125 <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>
3126 </p>
3127 !! end
3128
3129
3130
3131 !! test
3132 Character reference normalization in link text (bug 1938)
3133 !! input
3134 [[Main Page|this&that]]
3135 !! result
3136 <p><a href="/wiki/Main_Page" title="Main Page">this&amp;that</a>
3137 </p>
3138 !!end
3139
3140 !! test
3141 Empty attribute crash test (bug 2067)
3142 !! input
3143 <font color="">foo</font>
3144 !! result
3145 <p><font color="">foo</font>
3146 </p>
3147 !! end
3148
3149 !! test
3150 Empty attribute crash test single-quotes (bug 2067)
3151 !! input
3152 <font color=''>foo</font>
3153 !! result
3154 <p><font color="">foo</font>
3155 </p>
3156 !! end
3157
3158 !! test
3159 Attribute test: equals, then nothing
3160 !! input
3161 <font color=>foo</font>
3162 !! result
3163 <p><font>foo</font>
3164 </p>
3165 !! end
3166
3167 !! test
3168 Attribute test: unquoted value
3169 !! input
3170 <font color=x>foo</font>
3171 !! result
3172 <p><font color="x">foo</font>
3173 </p>
3174 !! end
3175
3176 !! test
3177 Attribute test: unquoted but illegal value (hash)
3178 !! input
3179 <font color=#x>foo</font>
3180 !! result
3181 <p><font color="#x">foo</font>
3182 </p>
3183 !! end
3184
3185 !! test
3186 Attribute test: no value
3187 !! input
3188 <font color>foo</font>
3189 !! result
3190 <p><font color="color">foo</font>
3191 </p>
3192 !! end
3193
3194 !! test
3195 Bug 2095: link with three closing brackets
3196 !! input
3197 [[Main Page]]]
3198 !! result
3199 <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>]
3200 </p>
3201 !! end
3202
3203 !! test
3204 Bug 2095: link with pipe and three closing brackets
3205 !! input
3206 [[Main Page|link]]]
3207 !! result
3208 <p><a href="/wiki/Main_Page" title="Main Page">link</a>]
3209 </p>
3210 !! end
3211
3212 !! test
3213 Bug 2095: link with pipe and three closing brackets, version 2
3214 !! input
3215 [[Main Page|[http://example.com/]]]
3216 !! result
3217 <p><a href="/wiki/Main_Page" title="Main Page">[http://example.com/]</a>
3218 </p>
3219 !! end
3220
3221
3222 ###
3223 ### Safety
3224 ###
3225
3226 !! article
3227 Template:Dangerous attribute
3228 !! text
3229 " onmouseover="alert(document.cookie)
3230 !! endarticle
3231
3232 !! article
3233 Template:Dangerous style attribute
3234 !! text
3235 border-size: expression(alert(document.cookie))
3236 !! endarticle
3237
3238 !! article
3239 Template:Div style
3240 !! text
3241 <div style="float: right; {{{1}}}">Magic div</div>
3242 !! endarticle
3243
3244 !! test
3245 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
3246 !! input
3247 <div title="{{test}}"></div>
3248 !! result
3249 <div title="This is a test template"></div>
3250
3251 !! end
3252
3253 !! test
3254 Bug 2304: HTML attribute safety (dangerous template; 2309)
3255 !! input
3256 <div title="{{dangerous attribute}}"></div>
3257 !! result
3258 <div title=""></div>
3259
3260 !! end
3261
3262 !! test
3263 Bug 2304: HTML attribute safety (dangerous style template; 2309)
3264 !! input
3265 <div style="{{dangerous style attribute}}"></div>
3266 !! result
3267 <div></div>
3268
3269 !! end
3270
3271 !! test
3272 Bug 2304: HTML attribute safety (safe parameter; 2309)
3273 !! input
3274 {{div style|width: 200px}}
3275 !! result
3276 <div style="float: right; width: 200px">Magic div</div>
3277
3278 !! end
3279
3280 !! test
3281 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
3282 !! input
3283 {{div style|width: expression(alert(document.cookie))}}
3284 !! result
3285 <div>Magic div</div>
3286
3287 !! end
3288
3289 !! test
3290 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
3291 !! input
3292 {{div style|"><script>alert(document.cookie)</script>}}
3293 !! result
3294 <div>Magic div</div>
3295
3296 !! end
3297
3298 !! test
3299 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
3300 !! input
3301 {{div style|" ><script>alert(document.cookie)</script>}}
3302 !! result
3303 <div style="float: right; ">Magic div</div>
3304
3305 !! end
3306
3307 !! test
3308 Bug 2304: HTML attribute safety (link)
3309 !! input
3310 <div title="[[Main Page]]"></div>
3311 !! result
3312 <div title="&#91;&#91;Main Page]]"></div>
3313
3314 !! end
3315
3316 !! test
3317 Bug 2304: HTML attribute safety (italics)
3318 !! input
3319 <div title="''foobar''"></div>
3320 !! result
3321 <div title="&#39;&#39;foobar&#39;&#39;"></div>
3322
3323 !! end
3324
3325 !! test
3326 Bug 2304: HTML attribute safety (bold)
3327 !! input
3328 <div title="'''foobar'''"></div>
3329 !! result
3330 <div title="&#39;&#39;'foobar&#39;&#39;'"></div>
3331
3332 !! end
3333
3334
3335 !! test
3336 Bug 2304: HTML attribute safety (ISBN)
3337 !! input
3338 <div title="ISBN 1234567890"></div>
3339 !! result
3340 <div title="&#73;SBN 1234567890"></div>
3341
3342 !! end
3343
3344 !! test
3345 Bug 2304: HTML attribute safety (RFC)
3346 !! input
3347 <div title="RFC 1234"></div>
3348 !! result
3349 <div title="&#82;FC 1234"></div>
3350
3351 !! end
3352
3353 !! test
3354 Bug 2304: HTML attribute safety (PMID)
3355 !! input
3356 <div title="PMID 1234567890"></div>
3357 !! result
3358 <div title="&#80;MID 1234567890"></div>
3359
3360 !! end
3361
3362 !! test
3363 Bug 2304: HTML attribute safety (web link)
3364 !! input
3365 <div title="http://example.com/"></div>
3366 !! result
3367 <div title="http&#58;//example.com/"></div>
3368
3369 !! end
3370
3371 !! test
3372 Bug 2304: HTML attribute safety (named web link)
3373 !! input
3374 <div title="[http://example.com/ link]"></div>
3375 !! result
3376 <div title="&#91;http&#58;//example.com/ link]"></div>
3377
3378 !! end
3379
3380 !! test
3381 Bug 3244: HTML attribute safety (extension; safe)
3382 !! input
3383 <div style="<nowiki>background:blue</nowiki>"></div>
3384 !! result
3385 <div style="background:blue"></div>
3386
3387 !! end
3388
3389 !! test
3390 Bug 3244: HTML attribute safety (extension; unsafe)
3391 !! input
3392 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
3393 !! result
3394 <div></div>
3395
3396 !! end
3397
3398 !! test
3399 Math section safety when disabled
3400 !! input
3401 <math><script>alert(document.cookies);</script></math>
3402 !! result
3403 <p>&lt;math&gt;&lt;script&gt;alert(document.cookies);&lt;/script&gt;&lt;/math&gt;
3404 </p>
3405 !! end
3406
3407 # More MSIE fun discovered by Tom Gilder
3408
3409 !! test
3410 MSIE CSS safety test: spurious slash
3411 !! input
3412 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
3413 !! result
3414 <div>evil</div>
3415
3416 !! end
3417
3418 !! test
3419 MSIE CSS safety test: hex code
3420 !! input
3421 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
3422 !! result
3423 <div>evil</div>
3424
3425 !! end
3426
3427 !! test
3428 MSIE CSS safety test: comment in url
3429 !! input
3430 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
3431 !! result
3432 <div style="background-image:u rl(javascript:alert('boo'))">evil</div>
3433
3434 !! end
3435
3436 !! test
3437 MSIE CSS safety test: comment in expression
3438 !! input
3439 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
3440 !! result
3441 <div style="background-image:expres sion(alert('boo4'))">evil4</div>
3442
3443 !! end
3444
3445
3446 !! test
3447 Table attribute legitimate extension
3448 !! input
3449 {|
3450 !+ style="<nowiki>color:blue</nowiki>"| status
3451 |}
3452 !! result
3453 <table>
3454 <tr>
3455 <th style="color:blue"> status
3456 </th></tr></table>
3457
3458 !!end
3459
3460 !! test
3461 Table attribute safety
3462 !! input
3463 {|
3464 !+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
3465 |}
3466 !! result
3467 <table>
3468 <tr>
3469 <th> status
3470 </th></tr></table>
3471
3472 !! end
3473
3474 ###
3475 ### Parser hooks (see maintenance/parserTestsParserHook.php for the <tag> extension)
3476 ###
3477 !! test
3478 Parser hook: empty input
3479 !! input
3480 <tag></tag>
3481 !! result
3482 <pre>
3483 string(0) ""
3484 array(0) {
3485 }
3486 </pre>
3487
3488 !! end
3489
3490 !! test
3491 Parser hook: empty input using terminated empty elements
3492 !! input
3493 <tag/>
3494 !! result
3495 <pre>
3496 NULL
3497 array(0) {
3498 }
3499 </pre>
3500
3501 !! end
3502
3503 !! test
3504 Parser hook: empty input using terminated empty elements (space before)
3505 !! input
3506 <tag />
3507 !! result
3508 <pre>
3509 NULL
3510 array(0) {
3511 }
3512 </pre>
3513
3514 !! end
3515
3516 !! test
3517 Parser hook: basic input
3518 !! input
3519 <tag>input</tag>
3520 !! result
3521 <pre>
3522 string(5) "input"
3523 array(0) {
3524 }
3525 </pre>
3526
3527 !! end
3528
3529
3530 !! test
3531 Parser hook: case insensetive
3532 !! input
3533 <TAG>input</TAG>
3534 !! result
3535 <pre>
3536 string(5) "input"
3537 array(0) {
3538 }
3539 </pre>
3540
3541 !! end
3542
3543
3544 !! test
3545 Parser hook: case insensetive, redux
3546 !! input
3547 <TaG>input</TAg>
3548 !! result
3549 <pre>
3550 string(5) "input"
3551 array(0) {
3552 }
3553 </pre>
3554
3555 !! end
3556
3557 !! test
3558 Parser hook: nested tags
3559 !! options
3560 noxml
3561 !! input
3562 <tag><tag></tag></tag>
3563 !! result
3564 <pre>
3565 string(5) "<tag>"
3566 array(0) {
3567 }
3568 </pre>&lt;/tag&gt;
3569
3570 !! end
3571
3572 !! test
3573 Parser hook: basic arguments
3574 !! input
3575 <tag width=200 height = "100" depth = '50' square></tag>
3576 !! result
3577 <pre>
3578 string(0) ""
3579 array(4) {
3580 ["width"]=>
3581 string(3) "200"
3582 ["height"]=>
3583 string(3) "100"
3584 ["depth"]=>
3585 string(2) "50"
3586 ["square"]=>
3587 string(6) "square"
3588 }
3589 </pre>
3590
3591 !! end
3592
3593 !! test
3594 Parser hook: argument containing a forward slash (bug 5344)
3595 !! input
3596 <tag filename='/tmp/bla'></tag>
3597 !! result
3598 <pre>
3599 string(0) ""
3600 array(1) {
3601 ["filename"]=>
3602 string(8) "/tmp/bla"
3603 }
3604 </pre>
3605
3606 !! end
3607
3608 !! test
3609 Parser hook: empty input using terminated empty elements (bug 2374)
3610 !! input
3611 <tag foo=bar/>text
3612 !! result
3613 <pre>
3614 NULL
3615 array(1) {
3616 ["foo"]=>
3617 string(3) "bar"
3618 }
3619 </pre>text
3620
3621 !! end
3622
3623 # </tag> should be output literally since there is no matching tag that begins it
3624 !! test
3625 Parser hook: basic arguments using terminated empty elements (bug 2374)
3626 !! input
3627 <tag width=200 height = "100" depth = '50' square/>
3628 other stuff
3629 </tag>
3630 !! result
3631 <pre>
3632 NULL
3633 array(4) {
3634 ["width"]=>
3635 string(3) "200"
3636 ["height"]=>
3637 string(3) "100"
3638 ["depth"]=>
3639 string(2) "50"
3640 ["square"]=>
3641 string(6) "square"
3642 }
3643 </pre>
3644 <p>other stuff
3645 &lt;/tag&gt;
3646 </p>
3647 !! end
3648
3649 ###
3650 ### (see maintenance/parserTestsStaticParserHook.php for the <statictag> extension)
3651 ###
3652
3653 !! test
3654 Parser hook: static parser hook not inside a comment
3655 !! input
3656 <statictag>hello, world</statictag>
3657 <statictag action=flush/>
3658 !! result
3659 <p>hello, world
3660 </p>
3661 !! end
3662
3663
3664 !! test
3665 Parser hook: static parser hook inside a comment
3666 !! input
3667 <!-- <statictag>hello, world</statictag> -->
3668 <statictag action=flush/>
3669 !! result
3670 <p><br />
3671 </p>
3672 !! end
3673
3674 # Nested template calls; this case was broken by Parser.php rev 1.506,
3675 # since reverted.
3676
3677 !! article
3678 Template:One-parameter
3679 !! text
3680 (My parameter is: {{{1}}})
3681 !! endarticle
3682
3683 !! article
3684 Template:Map-one-parameter
3685 !! text
3686 {{{{{1}}}|{{{2}}}}}
3687 !! endarticle
3688
3689 !! test
3690 Nested template calls
3691 !! input
3692 {{Map-one-parameter|One-parameter|param}}
3693 !! result
3694 <p>(My parameter is: param)
3695 </p>
3696 !! end
3697
3698
3699 ###
3700 ### Sanitizer
3701 ###
3702 !! test
3703 Sanitizer: Closing of open tags
3704 !! input
3705 <s></s><table></table>
3706 !! result
3707 <s></s><table></table>
3708
3709 !! end
3710
3711 !! test
3712 Sanitizer: Closing of open but not closed tags
3713 !! input
3714 <s>foo
3715 !! result
3716 <p><s>foo</s>
3717 </p>
3718 !! end
3719
3720 !! test
3721 Sanitizer: Closing of closed but not open tags
3722 !! input
3723 </s>
3724 !! result
3725 <p>&lt;/s&gt;
3726 </p>
3727 !! end
3728
3729 !! test
3730 Sanitizer: Closing of closed but not open table tags
3731 !! input
3732 Table not started</td></tr></table>
3733 !! result
3734 <p>Table not started&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
3735 </p>
3736 !! end
3737
3738 !! test
3739 Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
3740 !! input
3741 <span id="æ: v">byte</span>[[#æ: v|backlink]]
3742 !! result
3743 <p><span id=".C3.A6:_v">byte</span><a href="#.C3.A6:_v" title="">backlink</a>
3744 </p>
3745 !! end
3746
3747 !! test
3748 Sanitizer: Validating the contents of the id attribute (bug 4515)
3749 !! options
3750 disabled
3751 !! input
3752 <br id=9 />
3753 !! result
3754 Something, but defenetly not <br id="9" />...
3755 !! end
3756
3757 TODO:
3758 more images
3759 more tables
3760 math
3761 character entities
3762 and much more