Page MenuHomePhabricator

Template Parser does not treat ideographic spaces and non-breaking spaces as whitespace
Open, MediumPublic

Description

Author: alex

Description:
According to http://www.mediawiki.org/wiki/Help:Parser_functions_in_templates

    {{#if: {{{1|}}} | Parameter 1 is defined and non-null/non-empty. | Parameter 1 is not defined, or is defined but null. It contains only empty string(s) or breaking space(s) etc.}}

Result
    Parameter 1 is not defined, or is defined but null. It contains only empty string(s) or breaking space(s) etc.

But if Parameter 1 contains an Ideographic space 3000 rather an ASCII space 20 then it is treated as non-null.

This affects users editing a Latin based Wikipedia (i.e.. English) with a Asian based computer (i.e.. Japanese).

For example see this edit:

http://en.wikipedia.org/w/index.php?title=Kawagoe_Station&diff=306196218&oldid=305944473

which changes the spaces from U 3000 to U 20 and the "statistics" line in the Station infoboxes are then correctly formatted.

The U 3000 space should be evaluated as whitespace within a template if function.

For an example of the problem with non-breaking spaces, compare the output of the two revisions at https://zu.wikipedia.org/w/index.php?title=Hepatitis_A&type=revision&diff=38809&oldid=38808.

Details

Reference
bz20076

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:51 PM
bzimport set Reference to bz20076.
bzimport added a subscriber: Unknown Object (MLST).

Also, it looks like the template parser does not treat non-breaking space characters (0x00A0) as whitespace. This apparently has been breaking template output on the Zulu Wikipedia and some others.

kaldari renamed this task from Template Parser does not treat an Ideographic space 3000 as whitespace to Template Parser does not treat ideographic spaces and non-breaking spaces as whitespace.Aug 28 2015, 8:25 PM
kaldari raised the priority of this task from Low to Medium.
kaldari set Security to None.
kaldari added a subscriber: Doc_James.

Thanks having this fixed would be great as it would make translation easier.