[Mediawiki-l] Templates, Images, ParserFunctions, and newlines

Kelvin Chung kelvSYC at shaw.ca
Tue Sep 22 04:00:24 UTC 2009


I'm seeing this weird anomaly in wiki syntax.  Suppose you have this  
template, called A:

{{#switch: {{{1}}}
| foo = [[File:foo.png]]
| bar = [[File:bar.png]]
| baz = [[File:baz.png]]
| UNKNOWN
}}

Now, with something like

{{A|foo}} and {{A|bar}}.

I get

<p><img src="foo.png"/>
</p>
<pre>and <img src="bar.png"/>
</pre>
<p>.
</p>

That is, the " and {{A|bar}}" is treated as a new paragraph.  However,  
if I have

[[File:foo.png]] and [[File:bar.png]].

I get

<p><img src="foo.png"/> and <img src="bar.png"/>.
</p>

So there is something with the newlines that are at the end of each  
case, I'd presume.  Compacting this all into one line appears not to  
help.  How can I change Template:A so that I get the more desirable  
second outcome?



More information about the MediaWiki-l mailing list