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.