1 # The parsoid-compatible option below is only relevant when we are running
2 # parser tests in integrated mode with Parsoid. This option is ignored
3 # when this test file is run with Parsoid in standalone mode.
5 parsoid-compatible=wt2html,wt2wt
12 This is a test template
18 This is a test template with parameter {{{param}}}
24 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
30 <onlyinclude>Foo</onlyinclude>bar
34 pre-save transform: subst:
40 This is a test template
44 pre-save transform: normal template
54 pre-save transform: nonexistent template
58 {{thistemplatedoesnotexist}}
60 {{thistemplatedoesnotexist}}
64 pre-save transform: subst magic variables
73 # This is T2089, which I fixed. -- wtm
75 pre-save transform: subst: templates with parameters
79 {{subst:paramtest|param="something else"}}
81 This is a test template with parameter "something else"
87 <nowiki>'''not wiki'''</nowiki>
91 pre-save transform: nowiki in subst (T3188)
97 <nowiki>'''not wiki'''</nowiki>
103 This template has <!-- a comment --> in it.
107 pre-save transform: comment in subst (T3936)
111 {{subst:commenttest}}
113 This template has <!-- a comment --> in it.
117 pre-save transform: unclosed tag
121 <nowiki>'''not wiki'''
123 <nowiki>'''not wiki'''
127 pre-save transform: mixed tag case
131 <NOwiki>'''not wiki'''</noWIKI>
133 <NOwiki>'''not wiki'''</noWIKI>
137 pre-save transform: unclosed comment in <nowiki>
141 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
143 wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
146 # Leading @ in this template definition works around a limitation
147 # in parsoid's parserTests which otherwise strips the <span> from the
148 # result (confusing it for a template wrapper)
152 @<span onmouseover="alert('crap')">Oh no</span>
156 (confirming safety of fix for subst T3936)
158 {{Template:dangerous}}
160 <p>@<span>Oh no</span>
165 pre-save transform: comment containing gallery (T7024)
169 <!-- <gallery>data</gallery> -->
171 <!-- <gallery>data</gallery> -->
175 pre-save transform: comment containing extension
179 <!-- <tag>data</tag> -->
181 <!-- <tag>data</tag> -->
185 pre-save transform: comment containing nowiki
189 <!-- <nowiki>data</nowiki> -->
191 <!-- <nowiki>data</nowiki> -->
195 pre-save transform: <noinclude> in subst (T5298)
205 pre-save transform: <onlyinclude> in subst (T5298)
217 {{<includeonly>subst:</includeonly>Includes}}
221 Template:SafeSubstTest
223 {{<includeonly>safesubst:</includeonly>Includes}}
227 Template:SafeSubstSelfTest
229 {{safesubst:SafeSubstSelfTest}}
239 Template:ROOTPAGENAME
245 T24297: safesubst: works during PST
249 {{subst:SafeSubstTest}}{{safesubst:SubstTest}}
255 T24297: safesubst: works during normal parse
264 subst: does not work during normal parse
268 <p>{{subst:Includes}}
270 !! html/parsoid+integrated
271 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SubstTest","href":"./Template:SubstTest"},"params":{},"i":0}}]}'>{{subst:Includes}}</span></p>
275 safesubst self: does not work during normal parse - T276476
277 pst title=[[Template:SafeSubstSelfTest]]
279 {{SafeSubstSelfTest}}
281 {{SafeSubstSelfTest}}
286 Template named safesubst - T309405
293 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"safesubst","href":"./Template:Safesubst"},"params":{"1":{"wt":"123"}},"i":0}}]}'>123</span></p>
297 subst: with whitespace - variable vs. template
299 pst title=[[TestSubstVariable]]
301 Variable: {{subst: ROOTPAGENAME}}
302 Variable: {{subst:ROOTPAGENAME}}
303 Template: {{subst: ROOTPAGENAME|template}}
304 Template: {{subst:ROOTPAGENAME|template}}
306 Variable: TestSubstVariable
307 Variable: TestSubstVariable
308 Template: NotTheVariable
309 Template: NotTheVariable
313 pre-save transform: context links ("pipe trick")
317 [[Article (context)|]]
320 [[Bar:Article (context)|]]
321 [[:Bar:Article (context)|]]
323 [[|Article (context)]]
327 [[Article (context)|Article]]
328 [[Bar:Article|Article]]
329 [[:Bar:Article|Article]]
330 [[Bar:Article (context)|Article]]
331 [[:Bar:Article (context)|Article]]
333 [[Article (context)]]
334 [[Bar:X (Y) Z|X (Y) Z]]
335 [[:Bar:X (Y) Z|X (Y) Z]]
339 pre-save transform: context links ("pipe trick") with interwiki prefix
343 [[interwiki:Article|]]
344 [[:interwiki:Article|]]
345 [[interwiki:Bar:Article|]]
346 [[:interwiki:Bar:Article|]]
348 [[interwiki:Article|Article]]
349 [[:interwiki:Article|Article]]
350 [[interwiki:Bar:Article|Bar:Article]]
351 [[:interwiki:Bar:Article|Bar:Article]]
355 pre-save transform: context links ("pipe trick") with parens in title
357 pst title=[[Somearticle (context)]]
361 [[Article (context)|Article]]
365 pre-save transform: context links ("pipe trick") with single, double-width and Arabic comma in title
367 pst title=[[Someplace, Somewhere]]
370 [[Otherplace, Elsewhere|]]
371 [[Otherplace, Elsewhere, Anywhere|]]
372 [[Otherplace,Elsewhere|]]
373 [[Otherplace، Elsewhere|]]
375 [[Otherplace, Somewhere|Otherplace]]
376 [[Otherplace, Elsewhere|Otherplace]]
377 [[Otherplace, Elsewhere, Anywhere|Otherplace]]
378 [[Otherplace,Elsewhere|Otherplace]]
379 [[Otherplace، Elsewhere|Otherplace]]
383 pre-save transform: context links ("pipe trick") with parens and comma
385 pst title=[[Someplace (IGNORED), Somewhere]]
388 [[Otherplace (place), Elsewhere|]]
390 [[Otherplace, Somewhere|Otherplace]]
391 [[Otherplace (place), Elsewhere|Otherplace]]
395 pre-save transform: context links ("pipe trick") with comma and parens
397 pst title=[[Who, me? (context)]]
400 [[Me, Myself, and I (1937 song)|]]
402 [[Yes, you. (context)|Yes, you.]]
403 [[Me, Myself, and I (1937 song)|Me, Myself, and I]]
407 pre-save transform: context links ("pipe trick") with namespace
409 pst title=[[Ns:Somearticle]]
413 [[Ns:Article|Article]]
417 pre-save transform: context links ("pipe trick") with namespace and parens
419 pst title=[[Ns:Somearticle (context)]]
423 [[Ns:Article (context)|Article]]
427 pre-save transform: context links ("pipe trick") with namespace and comma
429 pst title=[[Ns:Somearticle, Context, Whatever]]
433 [[Ns:Article, Context, Whatever|Article]]
437 pre-save transform: context links ("pipe trick") with namespace, comma and parens
439 pst title=[[Ns:Somearticle, Context (context)]]
443 [[Ns:Article (context)|Article]]
447 pre-save transform: context links ("pipe trick") with namespace, parens and comma
449 pst title=[[Ns:Somearticle (IGNORED), Context]]
453 [[Ns:Article, Context|Article]]
457 pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, T32149)
461 [[Article(context)|]]
462 [[Bar:Article(context)|]]
463 [[:Bar:Article(context)|]]
464 [[|Article(context)]]
468 [[Article(context)|Article]]
469 [[Bar:Article(context)|Article]]
470 [[:Bar:Article(context)|Article]]
477 pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, T32149)
481 [[Article (context)|]]
482 [[Bar:Article (context)|]]
483 [[:Bar:Article (context)|]]
484 [[|Article (context)]]
488 [[Article (context)|Article]]
489 [[Bar:Article (context)|Article]]
490 [[:Bar:Article (context)|Article]]
491 [[Article (context)]]
492 [[Bar:X (Y) Z|X (Y) Z]]
493 [[:Bar:X (Y) Z|X (Y) Z]]
497 pre-save transform: context links ("pipe trick") with parens and no space (Korean style, T32149)
501 [[Article(context)|]]
502 [[Bar:Article(context)|]]
503 [[:Bar:Article(context)|]]
504 [[|Article(context)]]
508 [[Article(context)|Article]]
509 [[Bar:Article(context)|Article]]
510 [[:Bar:Article(context)|Article]]
517 pre-save transform: context links ("pipe trick") with commas (T23660)
521 [[Article (context), context|]]
522 [[Article (context),context|]]
523 [[Bar:Article (context), context|]]
524 [[Bar:Article (context),context|]]
525 [[:Bar:Article (context), context|]]
526 [[:Bar:Article (context),context|]]
528 [[Article (context), context|Article]]
529 [[Article (context),context|Article]]
530 [[Bar:Article (context), context|Article]]
531 [[Bar:Article (context),context|Article]]
532 [[:Bar:Article (context), context|Article]]
533 [[:Bar:Article (context),context|Article]]
537 Parsoid: backwards pipe trick
544 <p>[[|<b>bar</b>]]</p>
548 pre-save transform: trim trailing empty lines
552 Empty lines are trimmed
558 Empty lines are trimmed
562 pre-save transform: Signature expansion
569 * <noinclude>~~~</noinclude>
570 * <includeonly>~~~</includeonly>
571 * <onlyinclude>~~~</onlyinclude>
573 * [[Special:Contributions/127.0.0.1|127.0.0.1]]
574 * [[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
575 * 00:02, 1 January 1970 (UTC)
576 * <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
577 * <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
578 * <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
583 ParserOutput flags from signature expansion (T84843)
592 [[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
596 pre-save transform: Signature expansion in nowiki tags (T2093)
602 <nowiki>~~~~</nowiki>
604 <includeonly><nowiki>~~~~</nowiki></includeonly>
606 <noinclude><nowiki>~~~~</nowiki></noinclude>
608 <onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
610 {{subst:Foo}} shall be converted to FOO
612 As well as inside noinclude/onlyinclude
613 <noinclude>{{subst:Foo}}</noinclude>
614 <onlyinclude>{{subst:Foo}}</onlyinclude>
616 But not inside includeonly
617 <includeonly>{{subst:Foo}}</includeonly>
621 <nowiki>~~~~</nowiki>
623 <includeonly><nowiki>~~~~</nowiki></includeonly>
625 <noinclude><nowiki>~~~~</nowiki></noinclude>
627 <onlyinclude><nowiki>~~~~</nowiki></onlyinclude>
629 FOO shall be converted to FOO
631 As well as inside noinclude/onlyinclude
632 <noinclude>FOO</noinclude>
633 <onlyinclude>FOO</onlyinclude>
635 But not inside includeonly
636 <includeonly>{{subst:Foo}}</includeonly>
640 Parsoid: Recognize nowiki with trailing space in tags
644 <nowiki ><div>[[foo]]</nowiki >
652 <p><div>[[foo]]
653 </p><p>a<nowiki / >b
655 </p><p>e<nowiki/ >f
658 <p><span typeof="mw:Nowiki"><div>[[foo]]</span></p>
660 <p>a<nowiki / >b</p>
662 <p>c<span typeof="mw:Nowiki"></span>d</p>
664 <p>e<nowiki/ >f</p>
668 Category with empty sort key
673 [[Category:MediaWiki User's Guide|]]
675 [[Category:MediaWiki User's Guide|MediaWiki User's Guide]]
679 Category with empty sort key and parentheses
684 [[Category:Foo (bar)|]]
686 [[Category:Foo (bar)|Foo]]
690 Category with link tail
695 123[[Category:Foo]]456
697 123[[Category:Foo]]456
701 Category with template
706 [[Category:{{1x|Foo}}]]
708 [[Category:{{1x|Foo}}]]
712 Category with template in sort key
717 [[Category:Foo|{{1x|Bar}}]]
719 [[Category:Foo|{{1x|Bar}}]]
723 Category with template in sort key and title
728 [[Category:{{1x|Foo}}|{{1x|Bar}}]]
730 [[Category:{{1x|Foo}}|{{1x|Bar}}]]