Template:concat

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

{{{1}}}{{{2}}}


This template is needed to work around a MediaWiki bug. Whenever a parser function or template returns text beginning with an asterisk or some other special character, the software automatically adds a new line before it. This messes up some things, obviously. This template is intended to be used with named parameters, so you would call it as {{concat|1=text1|2=text2}}. MediaWiki automatically strips leading and trailing whitespace from parameters that are given with an = sign, so this will also strip the extra newline back out. The concatenation is needed because if this template were to just use one parameter, the newline would be added back in when {{concat}} itself returned its result, because that result would begin with *. This is prevented by prepending some text before the * so that it no longer occurs.