User:Jerimee/subtest

Note
gives the wikitext rendered as Template:TC.

foo gives fooz

workspace
fooz

The safesubst: modifier
The subst: modifier can be replaced by the alternative modifier safesubst:. The two have the same behaviour, except when they are encountered during non-substituted expansion (transclusion or direct viewing) of a template. In this situation, the code remains unparsed, whereas  is treated as if no modifier were present (so the subtemplate is transcluded or the variable or parser function evaluated).

Hence the safesubst: modifier is used in the code of templates which are designed to produce recursive substitution when substituted, but are also intended to work when transcluded – or simply to be viewed directly. Using plain subst: in such templates would break in the case of transclusion (and possibly on direct viewing). For details on how to implement this (in particular, how to prevent the substitution from being performed as soon as the template code is saved), see § Recursive substitution.