https://bugzilla.wikimedia.org/show_bug.cgi?id=32817

--- Comment #7 from [email protected] 2011-12-06 19:24:17 UTC ---
It would have been helpful if you had mention that critical fact. Why did you
not say it? It would have save some hours in this debugging process.

At first it appeared the feature is actually a bug, since it produces output
when none is required. Also, the new delimiter parameter cannot be used to
output a comma and space like this:

{{#arraymap:{{{Type|}}}|,|VariableValue|[[Type::VariableValue]]: {{#show:
VariableValue | ?Type name}}|, }}

Even though that is the default new delimiter output when nothing is specified
includes a space after the comma, when done like this:

{{#arraymap:{{{Type|}}}|,|VariableValue|[[Type::VariableValue]]: {{#show:
VariableValue | ?Type name}} }}

or like this:

{{#arraymap:{{{Type|}}}|,|VariableValue|[[Type::VariableValue]]: {{#show:
VariableValue | ?Type name}}}}

note the whitespace at the end, which was present only for readability, is
(properly) ignored by #arraymap, and was removed in the above example.

I tried using the C escape sequence \s to produce a space after the comma in
the new delimiter parameter, like this:

{{#arraymap:{{{Type|}}}|,|VariableValue|[[Type::VariableValue]]: {{#show:
VariableValue | ?Type name}}|,\s}}

But that does not work. Further research shows that PHP (the underlying
language) does not appear to have an escape character for a space:

http://php.net/manual/en/language.types.string.php

However, it DOES work with HTML entities, as described here:

http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

and used like this:

{{#arraymap:{{{Type|}}}|,|VariableValue|[[Type::VariableValue]]: {{#show:
VariableValue | ?Type name}}|, }}

So, the default new delimiter is presented in the documentation as being
optional, when actually it is not in the case where no output is expected. I
will leave this bug report marked as invalid, and I will update the
documentation with the information I have tested about how the #arraymap parser
function works.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to