Foobar
!! end !! test subst: does not work during normal parse !! wikitext {{SubstTest}} !! html{{subst:Includes}}
!! html/parsoid+integrated{{subst:Includes}}
!! end !! test safesubst self: does not work during normal parse - T276476 !! options pst title=[[Template:SafeSubstSelfTest]] !! wikitext {{SafeSubstSelfTest}} !! html/php {{SafeSubstSelfTest}} !! end ## Non-PST test !! test Template named safesubst - T309405 !! wikitext {{safesubst|123}} !! html/php123
!! html/parsoid123
!! end !! test subst: with whitespace - variable vs. template !! options pst title=[[TestSubstVariable]] !! wikitext Variable: {{subst: ROOTPAGENAME}} Variable: {{subst:ROOTPAGENAME}} Template: {{subst: ROOTPAGENAME|template}} Template: {{subst:ROOTPAGENAME|template}} !! html/php Variable: TestSubstVariable Variable: TestSubstVariable Template: NotTheVariable Template: NotTheVariable !! end !! test pre-save transform: context links ("pipe trick") !! options pst !! wikitext [[Article (context)|]] [[Bar:Article|]] [[:Bar:Article|]] [[Bar:Article (context)|]] [[:Bar:Article (context)|]] [[|Article]] [[|Article (context)]] [[Bar:X (Y) Z|]] [[:Bar:X (Y) Z|]] !! html/php [[Article (context)|Article]] [[Bar:Article|Article]] [[:Bar:Article|Article]] [[Bar:Article (context)|Article]] [[:Bar:Article (context)|Article]] [[Article]] [[Article (context)]] [[Bar:X (Y) Z|X (Y) Z]] [[:Bar:X (Y) Z|X (Y) Z]] !! end !! test pre-save transform: context links ("pipe trick") with interwiki prefix !! options pst !! wikitext [[interwiki:Article|]] [[:interwiki:Article|]] [[interwiki:Bar:Article|]] [[:interwiki:Bar:Article|]] !! html/php [[interwiki:Article|Article]] [[:interwiki:Article|Article]] [[interwiki:Bar:Article|Bar:Article]] [[:interwiki:Bar:Article|Bar:Article]] !! end !! test pre-save transform: context links ("pipe trick") with parens in title !! options pst title=[[Somearticle (context)]] !! wikitext [[|Article]] !! html/php [[Article (context)|Article]] !! end !! test pre-save transform: context links ("pipe trick") with single, double-width and Arabic comma in title !! options pst title=[[Someplace, Somewhere]] !! wikitext [[|Otherplace]] [[Otherplace, Elsewhere|]] [[Otherplace, Elsewhere, Anywhere|]] [[Otherplace,Elsewhere|]] [[Otherplace، Elsewhere|]] !! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace, Elsewhere|Otherplace]] [[Otherplace, Elsewhere, Anywhere|Otherplace]] [[Otherplace,Elsewhere|Otherplace]] [[Otherplace، Elsewhere|Otherplace]] !! end !! test pre-save transform: context links ("pipe trick") with parens and comma !! options pst title=[[Someplace (IGNORED), Somewhere]] !! wikitext [[|Otherplace]] [[Otherplace (place), Elsewhere|]] !! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace (place), Elsewhere|Otherplace]] !! end !! test pre-save transform: context links ("pipe trick") with comma and parens !! options pst title=[[Who, me? (context)]] !! wikitext [[|Yes, you.]] [[Me, Myself, and I (1937 song)|]] !! html/php [[Yes, you. (context)|Yes, you.]] [[Me, Myself, and I (1937 song)|Me, Myself, and I]] !! end !! test pre-save transform: context links ("pipe trick") with namespace !! options pst title=[[Ns:Somearticle]] !! wikitext [[|Article]] !! html/php [[Ns:Article|Article]] !! end !! test pre-save transform: context links ("pipe trick") with namespace and parens !! options pst title=[[Ns:Somearticle (context)]] !! wikitext [[|Article]] !! html/php [[Ns:Article (context)|Article]] !! end !! test pre-save transform: context links ("pipe trick") with namespace and comma !! options pst title=[[Ns:Somearticle, Context, Whatever]] !! wikitext [[|Article]] !! html/php [[Ns:Article, Context, Whatever|Article]] !! end !! test pre-save transform: context links ("pipe trick") with namespace, comma and parens !! options pst title=[[Ns:Somearticle, Context (context)]] !! wikitext [[|Article]] !! html/php [[Ns:Article (context)|Article]] !! end !! test pre-save transform: context links ("pipe trick") with namespace, parens and comma !! options pst title=[[Ns:Somearticle (IGNORED), Context]] !! wikitext [[|Article]] !! html/php [[Ns:Article, Context|Article]] !! end !! test pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, T32149) !! options pst !! wikitext [[Article(context)|]] [[Bar:Article(context)|]] [[:Bar:Article(context)|]] [[|Article(context)]] [[Bar:X(Y)Z|]] [[:Bar:X(Y)Z|]] !! html/php [[Article(context)|Article]] [[Bar:Article(context)|Article]] [[:Bar:Article(context)|Article]] [[Article(context)]] [[Bar:X(Y)Z|X(Y)Z]] [[:Bar:X(Y)Z|X(Y)Z]] !! end !! test pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, T32149) !! options pst !! wikitext [[Article (context)|]] [[Bar:Article (context)|]] [[:Bar:Article (context)|]] [[|Article (context)]] [[Bar:X (Y) Z|]] [[:Bar:X (Y) Z|]] !! html/php [[Article (context)|Article]] [[Bar:Article (context)|Article]] [[:Bar:Article (context)|Article]] [[Article (context)]] [[Bar:X (Y) Z|X (Y) Z]] [[:Bar:X (Y) Z|X (Y) Z]] !! end !! test pre-save transform: context links ("pipe trick") with parens and no space (Korean style, T32149) !! options pst !! wikitext [[Article(context)|]] [[Bar:Article(context)|]] [[:Bar:Article(context)|]] [[|Article(context)]] [[Bar:X(Y)Z|]] [[:Bar:X(Y)Z|]] !! html/php [[Article(context)|Article]] [[Bar:Article(context)|Article]] [[:Bar:Article(context)|Article]] [[Article(context)]] [[Bar:X(Y)Z|X(Y)Z]] [[:Bar:X(Y)Z|X(Y)Z]] !! end !! test pre-save transform: context links ("pipe trick") with commas (T23660) !! options pst !! wikitext [[Article (context), context|]] [[Article (context),context|]] [[Bar:Article (context), context|]] [[Bar:Article (context),context|]] [[:Bar:Article (context), context|]] [[:Bar:Article (context),context|]] !! html/php [[Article (context), context|Article]] [[Article (context),context|Article]] [[Bar:Article (context), context|Article]] [[Bar:Article (context),context|Article]] [[:Bar:Article (context), context|Article]] [[:Bar:Article (context),context|Article]] !! end !! test Parsoid: backwards pipe trick !! wikitext [[|'''bar''']] !! html/php[[|bar]]
!! html/parsoid[[|bar]]
!! end !! test pre-save transform: trim trailing empty lines !! options pst !! wikitext Empty lines are trimmed !! html/php Empty lines are trimmed !! end !! test pre-save transform: Signature expansion !! options pst !! wikitext * ~~~ * ~~~~ * ~~~~~ *<div>[[foo]]
a<nowiki / >b
cd
e<nowiki/ >f
!! html/parsoid<div>[[foo]]
a<nowiki / >b
cd
e<nowiki/ >f
!! end !! test Category with empty sort key !! options cat pst !! wikitext [[Category:MediaWiki User's Guide|]] !! html/php [[Category:MediaWiki User's Guide|MediaWiki User's Guide]] !! end !! test Category with empty sort key and parentheses !! options cat pst !! wikitext [[Category:Foo (bar)|]] !! html/php [[Category:Foo (bar)|Foo]] !! end !! test Category with link tail !! options cat pst !! wikitext 123[[Category:Foo]]456 !! html/php 123[[Category:Foo]]456 !! end !! test Category with template !! options cat pst !! wikitext [[Category:{{1x|Foo}}]] !! html/php [[Category:{{1x|Foo}}]] !! end !! test Category with template in sort key !! options cat pst !! wikitext [[Category:Foo|{{1x|Bar}}]] !! html/php [[Category:Foo|{{1x|Bar}}]] !! end !! test Category with template in sort key and title !! options cat pst !! wikitext [[Category:{{1x|Foo}}|{{1x|Bar}}]] !! html/php [[Category:{{1x|Foo}}|{{1x|Bar}}]] !! end !! test Tildes in comments !! options pst !! wikitext !! html/php !! end