Forum:Template output different when passed as parameter

I've had a streak of stupid mistakes lately, but there's no way I'm wrong with this one. (Now watch it turn out that I am...)

I have a template (tests) that finds the date of the next inauguration for a given political office, based on semantic queries. But the semantic features aren't the problem or I would have asked on the Nabble list. If the template's output is passed as a parameter to , it changes...! I'm using identical input and output formats for the parser function, so what goes in should come out. EDIT: I should also mention that I tried directly inputting the date to and it worked.

= January 1, 2012 = January 1, 2009

But it gets weirder; the rules of arithmetic seem to be ignored. 2009 shouldn't be allowed as the year number because it's an odd number. After the semantic queries have been evaluated, the opening condition is like this:

I have no idea how 2009 gets past that condition; even if the second argument were regarded as empty and therefore defaulted to the current year, the condition should return false because (2009 mod 2 != 0).

If this involves too much semantic content, just say so and I'll head over to Nabble. I would just rather not ask them about an ordinary problem, as that's not what the list is for.

Thanks. --Jesdisciple (talk) 03:58, 30 June 2009 (UTC)


 * Alright, I have a minimal test case for this now... And I'm finally right! ...sort of.  Removing the newline in the following code fixes the problem (the linebreak is invisible in the calling page untill you view source).  Note that the template is calling itself from outside of its tags.

January 1, 2012


 * So, is this a bug or should I never use newlines for clarity in my templates? --Jesdisciple (talk) 15:55, 30 June 2009 (UTC)