[Mediawiki-l] Leading or trailing spaces in template parameters

Jean-Marc van Leerdam j.m.van.leerdam at gmail.com
Tue Mar 31 20:38:03 UTC 2009


Hi,


2009/3/31 Kenneth Porter <shiva at sewingwitch.com>:
> On Tuesday, March 31, 2009 8:43 PM +0200 Jean-Marc van Leerdam
> <j.m.van.leerdam at gmail.com> wrote:
>
>> Try using HTML escaped spaces: &#32;
>
> The resulting URL expanded to "&#32;M+A&#32;" and then got HTTP encoded to
> "%26%2332%3BM+A%26%2332%3B".
>
> HTTP encoding has a similar problem. I also tried to quote the parameter
> and, while the spaces then make it in, the quotes also get included in the
> result, not what I want.
>

You are using a mediawiki wiki? This works just fine for me:

-- start WIKI text--
=Template testing=

Here is a [{{SP}}] space?

Through a template this looks like: {{Test|&#32;}}

Template template: {{Test|{{SP}}}}

Total: {{Test|{{SP}}M{{SP}}A{{SP}}}}
-- end WIKI text
-- start Result
Template testing

Here is a [ ] space?

Through a template this looks like: Hi there, how are [ ] you?

Template template: Hi there, how are [ ] you?

Total: Hi there, how are [ M A ] you?
-- end Result

Template:SP contains a single line:
&#32;
Template:Test contains a single line:
Hi there, how are [{{{1}}}] you?


-- 
Regards,

Jean-Marc
--
       ___
  @@  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net



More information about the MediaWiki-l mailing list