Predefinição:StripWhitespace/doc
Esta é uma subpágina de documentação para Predefinição:StripWhitespace (Clique na ligação se você quer vê-la diretamente). Ela contém informações sobre o uso, categorias e outros conteúdos que não são parte da predefinição propriamente dita. |
This template should not be substituted. |
This is a simple little template, for use in other templates to strip any trailing and/or leading whitespace from unnamed parameters (See original template on English Wikipedia).
In MediaWiki templates, trailing and/or leading whitespace is automatically removed from named parameters, but not from unnamed parameters. (Thus we can choose whether this removal is applied, but the choice cannot be made independently of the choice to use named or unnamed parameters. This is apparently some ancient design mistake with which we are now stuck forevermore, in the name of backward-compatibility.[1])
Usage
[editar]The template takes either a parameter, "x", or one unnamed parameter. The value should be numbered parameter from which the whitespace is to be removed.
- {{StripWhitespace | x = {{{1|}}} }}
or:
- {{StripWhitespace | {{{4|}}} }}
Do not substitute this template – that is, if used as {{subst:StripWhitespace}}
, the resulting wikicode is not "clean".
Notes
[editar]- ↑ Unfortunately the reverse, avoiding the removal of whitespace while using a named parameter, is not possible.
See also
[editar]- {{Trim}}, which does nearly the exact same thing, but which may be substituted.