William Allen Simpson wrote:
{{{{{subst|}}}#if:{{{par1|}}}|[[Category:{{{par1}}}{{{{{subst|}}}#if:{{{key1|}}}{{{{{subst|}}}!}}{{{key1}}}}}]] <!-- bpar1 --> }}{{{{{subst|}}}#if:{{{par2|}}}|[[Category:{{{par2}}}{{{{{subst|}}}#if:{{{key2|}}}{{{{{subst|}}}!}}{{{key2}}}}}]] <!-- bpar2 --> }}{{{{{subst|}}}#if:{{{par3|}}}|[[Category:{{{par3}}}{{{{{subst|}}}#if:{{{key3|}}}{{{{{subst|}}}!}}{{{key3}}}}}]] <!-- bpar3 --> }}
Nothing like a wikitext puzzle to start off your day.
Did the evaluation order change, so the inner {{subst:!}} happens first instead of second, and loses the C parameter (interpreting it as "else")?
{{subst:!}} no longer works as a separator between parser function parameters, it just works as a literal character. Welcome to MediaWiki 1.12. See:
http://meta.wikimedia.org/wiki/MNPP
For those playing at home, the simplified test case is:
{{#if: a {{!}} b }}
The condition "a | b" is true, but no return value is specified, so the default return is used, i.e. an empty string
And the leading and trailing linebreaks are slurped up and ignored?
Whitespace at the beginning and end of a parameter to #if, #ifeq, #switch, etc. is stripped. This was always the case in HTML mode, at least since MW 1.7. It's possible MW 1.12 changed it for subst mode.
Any known work around? (I tried searching meta and elsewhere, but no joy.)
Use "|" instead of "{{{{{subst|}}}!}}". Not only will it work, it'll be easier to read.
The workarounds that come to mind for the line break issue are fairly obscure and complex. If I were you I'd just put the categories on the same line and be done with it.
-- Tim Starling