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


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:

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

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

<references />

In read mode, everything looks right:

Hello world.[1]

An image[2]


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

In VisualEditor, you get this:

Hello world.[1]

An image[1]

  1. ^ A footnote for the image


  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.



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="//" width="120" height="79" srcset="// 1.5x, // 2x" data-file-width="300" data-file-height="197"/></a></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>
</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?