Images: {{Gallery}} template parsed differently by PHP parser and Parsoid
OpenPublic

Assigned To
None
Priority
Normal
Author
ssastry
Subscribers
Elitre, ssastry
Projects
Reference
bz57263
Security
None
Description

{{Gallery}} is implemented by a Lua template here: https://en.wikipedia.org/wiki/Module:Gallery

See example below

[subbu@earth lib] cat /tmp/gallery
{{Gallery

lines = 2
File:Arc de Triomphe de l'Etoile - Projet Chalgrin - 02.jpg1806: Architectural drawing project of [[Jean Chalgrin]]

}}

[subbu@earth lib] node parse --dump tplsrc < /tmp/gallery

Template:Gallery

<table style="background:transparent;border:1px solid #f0f0f0;margin-top:0.5em;"><tr><td><table style="width:200px;float:left;border-collapse:collapse;margin:3px;"><tr><td style="height:200px;border:1px solid #CCCCCC;background-color:#F8F8F8;padding:0px;text-align:center;">[[File:Arc de Triomphe de l'Etoile - Projet Chalgrin - 02.jpg|center|border|180x180px|alt=|1806: Architectural drawing project of [[Jean Chalgrin]]]]</td></tr><tr style="vertical-align:top;"><td style="display:block;font-size:1em;height:3.2em;padding:0px;"><div class="gallerytext" style="height:3.1em;width:187px;line-height:1.3em;padding:2px 6px 1px 6px;overflow-y:auto;margin:0px;border:none;border-width:0px;">1806: Architectural drawing project of [[Jean Chalgrin]]&nbsp;</div></td></tr></table></td></tr></table>

So, the {{Gallery}} template emits the image in a <td> and the caption in a separate <tr> below. As far as I can tell, Parsoid therefore (correctly) duplicates the caption in both the <tr>s. However, somehow, the PHP parser magically suppresses the first caption (see https://en.wikipedia.org/w/index.php?title=User:Ssastry/sandbox&oldid=582405791)

This is based on a report on VE/F @ https://en.wikipedia.org/w/index.php?title=Wikipedia:VisualEditor/Feedback&oldid=582367222#Pages_that_go_wrong_in_VE


Version: unspecified
Severity: normal

bzimport added a project: Parsoid.Via ConduitNov 22 2014, 2:24 AM
bzimport set Reference to bz57263.
ssastry created this task.Via LegacyNov 19 2013, 6:30 PM
Arlolra placed this task up for grabs.Via WebNov 25 2014, 7:59 PM
Arlolra set Security to None.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.