Page MenuHomePhabricator

Stray apostrophe in template renderer
Closed, InvalidPublic

Description

Author: timwi

Description:
See: http://en.wikipedia.org/wiki/Nazareth

Notice the stray apostrophe underneath the image in the infobox on the right.

The template in question is: http://en.wikipedia.org/wiki/Template:Infobox_Israel_muni

I've experimented with it a bit and it seems that the apostrophe is generated by this line:

{{!}} style="vertical-align: middle; {{#if:{{{image2|}}}|padding-right:3px}}" align="center" {{!}} [[Image:{{{image<noinclude>{{!}}Placeholder.png</noinclude>}}}{{#if:{{{imgsize|}}}|{{!}}{{{imgsize}}}px}}<noinclude>{{!}}230px</noinclude>]]<br />''{{{caption| }}}''

The code -> ''{{{caption| }}}'' <- appears to be rendered as an apostrophe if an image but no caption is given. If no image is given, or a caption is given, or both, the bug does not occur.


Version: unspecified
Severity: enhancement

Details

Reference
bz12544

Event Timeline

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

In the template invocation, you had caption set to an empty string, it wasn't missing altogether. Thus ''{{caption| }}'' was expanded to '''', not '' ''. '''' is interpreted as an apostrophe plus a switch to bold. There are many possible fixes for this, and I have implemented one of them in the template.

Not a MediaWiki bug: {{test|x=}} will cause {{{x|default}}} to give an empty string, not "default". This is appropriate and stable behaviour.