Page MenuHomePhabricator

Initial list character in parameter not accepted unless parameter at beginning of line in template
Closed, InvalidPublic

Description

Author: brian

Description:
When a template parameter is a list, the first item is missed because
the "*" is misinterpreted.

define Template:PersonalData

'''Given name'''{{{GivenName|Unknown}}}
'''Children'''{{{Children|Unknown}}}

Use it by
{{PersonalData

GivenName=Given Name
Children=
  • Child One
  • Child Two}}

Child one gets an unformatted "*" instead of a bullet.


Version: unspecified
Severity: enhancement

Details

Reference
bz6496

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:22 PM
bzimport set Reference to bz6496.
bzimport added a subscriber: Unknown Object (MLST).

You can fix it by setting PersonalData to

'''Given name'''{{{GivenName|Unknown}}}
'''Children'''{{{Children|Unknown}}}

brian wrote:

The fix worked--Thank you!
However, I still think the real fix should be to make
the first form work correctly.

ayg wrote:

Leading and ending whitespace is deliberately stripped from template parameters,
because otherwise everything would have to be on the same line with no spaces in
the template call, which can be ugly for big templates. This is intended
behavior at present. Should an exception be made if a parameter starts on its
own line in the call *and* the first character is a list character?

brian wrote:

I understand better now. I think the exception is not
necessary. If modifying the template is not possible
(Comment #1 is not implementable), putting in a
<nowiki></nowiki> in front of the template argument
can also move the leading white space away so it would
not be stripped.