Page MenuHomePhabricator

Linter false positive: "Center/Left/Right" as caption for gallery image
Open, Needs TriagePublic



The words "Center", "Left", or "Right" used as a caption for a gallery image work fine but are detected as a Linter error. does not contain a workaround like "caption=" or "1=" for gallery image captions.

This is actually a Parsoid/Gallery bug which consumes the captions if they are the words left, center or right and treats them as halign values that are invalid, and also causes erroneous linter errors. See:
for further details

Event Timeline

Notes: If looks like the use of left, right or center as caption words not only generates linter errors, the captions are not there, as the words have been eaten as options and not allowed to be captions. In looking at this further, the use of left, right or center in gallary seems not to be valid as an option, and so should be allowed as captions. In the following example,


produces linter error:


and renders as:

... class="gallerytext" data-parsoid="{}"></div></li>
... class="gallerytext" data-parsoid='{"dsr":[47,55,0,0]}'>notaleft</div></li>
Sbailey added a subscriber: Sbailey.

I'm not sure if this is the same bug or a different bug, but I just came across something similar with "Frame". This syntax on en.WP renders correctly (the word "Frame" appears as a caption) but generates a Linter false positive error:

[[File:Frame front 30.jpg|right|thumb|100px|Frame]]

Once again, the lack of a caption= option to override this quirk is a problem. I hope that someone is willing to take the time to gather all of these File syntax tasks and sort out ticket T274382.