Page MenuHomePhabricator

VisualEditor: References inside galleries being displayed separately, inside the gallery, instead of in the correct <references /> block at the end of the page
Closed, DuplicatePublic

Description

Open a page containing some refs, and then a gallery that contains <ref> tags but no <references /> block inside the gallery. (The references block can be elsewhere on the page.) For example:

==Section==
Hello world.<ref>First footnote</ref>

==Gallery==
<gallery>
File:Example.jpg|An image<ref>A footnote for the image</ref>
</gallery>

==References==
<references />

In read mode, everything looks right:

Section
Hello world.[1]

Gallery
An image[2]

References

  1. ^ First footnote
  2. ^ A footnote for the image

In VisualEditor, you get this:

Section
Hello world.[1]

Gallery
An image[1]

  1. ^ A footnote for the image

References

  1. ^ First footnote

Screen_Shot_2014-11-01_at_8.54.03_AM.png (311×500 px, 21 KB)

VisualEditor seems to be inserting a ref block into the gallery, even though none exists at that point on the page. Also, it restarts the numbers for the gallery.

Details

Reference
bz72865

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:57 AM
bzimport set Reference to bz72865.
Jdforrester-WMF raised the priority of this task from Low to Medium.Jan 20 2015, 8:14 PM
Jdforrester-WMF lowered the priority of this task from Medium to Low.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.

Reproducible in Parsoid:

$ echo -e "<gallery>\nFile:foo.jpg|A <ref group="n">ref one</ref>\n</gallery>" | node parse

<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:foo.jpg|A &lt;ref group=n>ref one&lt;/ref>\n"}}' data-parsoid='{"dsr":[0,62,2,2]}' about="#mwt3">
<li class="gallerybox" style="width: 155px">
<div style="width: 155px">
<div class="thumb" style="width: 150px;">
<div style="margin:35.5px auto;"><a href="/wiki/File:Foo.jpg" class="image"><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/120px-Foo.jpg" width="120" height="79" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/180px-Foo.jpg 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/240px-Foo.jpg 2x" data-file-width="300" data-file-height="197"/></a></div>
</div>
<div class="gallerytext">
<p>A <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span>[</span>n 1<span>]</span></a></sup></p>
</div>
</div>
</li>
</ul><span about="#mwt3">
</span><p about="#mwt3"><br/>
<strong class="error mw-ext-cite-error">Cite error: There are <code>&lt;ref group=n></code> tags on this page, but the references will not show without a <code>{{reflist|group=n}}</code> template (see the <a href="/wiki/Help:Cite_errors/Cite_error_group_refs_without_references" title="Help:Cite errors/Cite error group refs without references">help page</a>).</strong>
<link rel="mw:PageProp/Category" href="./Category:Pages_with_missing_references_list#Main%20Page"/></p>

Could this be caused by using the <gallery>'s contents as a whole page, thus confusing Cite.php?