Module talk:DemoTemplate
Appearance
Doesn't preserve outer spacing
See how it doesn't preserve outer spaces around " two inner spaces ". Is that the way we want it to behave? Or is it just the MediaWiki software?
{{#invoke:DemoTemplate|Val/find|pattern= two inner spaces }}
→ {{Val/find|pattern=two inner spaces}}
→ Template:Val/find Thanks. — CpiralCpiral 08:43, 24 June 2015 (UTC)
- All templates do that. Whitespace at the start and end is stripped in all named and explicitly numbered parameters, but not in unnamed ones:
- Since whitespace is stripped before a parameter is passed into a module/template, nothing can be done within this module, but whitespace can be kept by adding
<nowiki/>
when using it:"{{echo|1=<nowiki/> abc <nowiki/>}}"
→ "Error in Template:Reply to: Input contains forbidden characters.""{{#invoke:DemoTemplate|echo|1=<nowiki/> abc <nowiki/>}}"
→ "{{echo|'"`UNIQ--nowiki-0000000A-QINU`"' abc '"`UNIQ--nowiki-0000000B-QINU`"'}}
→ Error in Template:Reply to: Input contains forbidden characters."
- SiBr4 (talk) 15:28, 24 June 2015 (UTC)
Doesn't preserve order of parameters
{{#invoke:DemoTemplate|Val|11|p=$|upl=acre}}
→ {{Val|11|upl=acre|p=$}}
→ $11/acre
— CpiralCpiral 23:16, 19 July 2015 (UTC)