Page MenuHomePhabricator

VisualEditor: Uses of enwiki's {{Plain image with caption}} cause alt text to be displayed as a caption
Closed, ResolvedPublic

Description

See https://en.wikipedia.org/wiki/Chloroplast?veaction=edit for example.


Version: unspecified
Severity: normal

Details

Reference
bz50113

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:59 AM
bzimport set Reference to bz50113.

(In reply to comment #0)

See https://en.wikipedia.org/wiki/Chloroplast?veaction=edit for example.

Can you say where? There's 27 images on that page and 15 of them are non-captioned images, but I don't see the alt-text coming through for them.

First image, top right; I suspect stupidity in the {{Plain image}} template.

It looks like this is [[File:…|right|«alt text»]] is getting wrongly interpreted by Parsoid as a thumb image as opposed to a block image (which doesn't have a caption):

[[File:{{Remove file prefix|{{{1|{{{image<noinclude>|Example.svg</noinclude>}}}}}}}}|right|{{Str number/trim|{{{3|{{{width|250px}}}}}}}}px|{{{2|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}}]]

->

<figure class="mw-halign-right" typeof="mw:Image" data-parsoid="…">

<a href="./File:Chloroplast_II.svg" data-parsoid="…"><img resource="./File:Chloroplast_II.svg" src="…" height="344" width="360" data-parsoid="…"></a>
<figcaption class="mw-figcaption" data-parsoid="{}">Structure of a typical higher-plant chloroplast</figcaption>

</figure>

(The <figcaption> shouldn't be set, and also there should be an alt="" set.)

Related URL: https://gerrit.wikimedia.org/r/70336 (Gerrit Change I24491979bc7a27d2380924e48cb677b01e9f8f9b)

https://gerrit.wikimedia.org/r/70336 (Gerrit Change I24491979bc7a27d2380924e48cb677b01e9f8f9b) | change APPROVED and MERGED [by jenkins-bot]

Gerrit 70336 is a quick hack to fix this in VisualEditor. Parsoid bug for a proper fix (longer-term) is bug 50142.