সাঁচ:StripWhitespace
This is a simple little template, for use in other templates to strip any trailing and/or leading whitespace from unnamed parameters.
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
[সম্পাদনা কৰক]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
e.g. {{StripWhitespace | x = {{{1|}}} }}
or e.g. {{StripWhitespace | {{{4|}}} }}
- Notes
- ↑ Unfortunately the reverse, avoiding the removal of whitespace while using a named parameter, is not possible.
See also
[সম্পাদনা কৰক]- {{Trim}}, which does nearly the exact same thing
The above documentation is transcluded from সাঁচ:StripWhitespace/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |