Page MenuHomePhabricator

List-defined nested references "inherit" the references list's group name in Parsoid
Open, Needs TriagePublic

Assigned To
None
Authored By
matmarex
Oct 29 2023, 8:17 PM
Referenced Files
F41154751: image.png
Oct 29 2023, 8:17 PM
F41154747: image.png
Oct 29 2023, 8:17 PM
F41154710: image.png
Oct 29 2023, 8:17 PM
F41154708: image.png
Oct 29 2023, 8:17 PM
Subscribers

Description

List-defined nested references "inherit" the references lists' group name in Parsoid.

Demo: https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Matma_Rex/brudnopis&oldid=71642707&action=parsermigration-edit

Input:

test<ref group=a name=a />

{{#tag:references|
{{#tag:ref|a<ref>b</ref>|name=a}}
|group=a}}

<references />

Expected rendering – produced by the old parser:

image.png (81×233 px, 1 KB)

<p>test<sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1" title="">[a 1]</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0" aria-label="Skocz do góry" title="Skocz do góry"></a></span> <span class="reference-text">a<sup id="cite_ref-2" class="reference"><a href="#cite_note-2" title="">[1]</a></sup></span>
</li>
</ol></div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2" aria-label="Skocz do góry" title="Skocz do góry"></a></span> <span class="reference-text">b</span>
</li>
</ol></div>

Actual rendering – produced by Parsoid:

image.png (81×233 px, 1 KB)

<p id="mwAg">test<sup about="#mwt2" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;attrs&quot;:{&quot;group&quot;:&quot;a&quot;,&quot;name&quot;:&quot;a&quot;}}"><a href="./Wikipedysta:Matma_Rex/brudnopis#cite_note-a-1" style="counter-reset: mw-Ref 1;" data-mw-group="a" id="mwAw"><span class="mw-reflink-text" id="mwBA">[a 1]</span></a></sup></p>

<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt4" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;#tag:references&quot;,&quot;function&quot;:&quot;tag&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;\n{{#tag:ref|a<ref>b</ref>|name=a}}\n&quot;},&quot;group&quot;:{&quot;wt&quot;:&quot;a&quot;}},&quot;i&quot;:0}}]}" id="mwBQ"><ol class="mw-references references" data-mw-group="a" id="mwBg"><li about="#cite_note-a-1" id="cite_note-a-1"><a href="./Wikipedysta:Matma_Rex/brudnopis#cite_ref-a_1-0" data-mw-group="a" rel="mw:referencedBy" id="mwBw"><span class="mw-linkback-text" id="mwCA"></span></a> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">a<sup about="#mwt8" class="mw-ref reference" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;attrs&quot;:{},&quot;body&quot;:{&quot;id&quot;:&quot;mw-reference-text-cite_note-2&quot;},&quot;errors&quot;:[{&quot;key&quot;:&quot;cite_error_references_no_key&quot;}]}" id="mwCQ"><a href="./Wikipedysta:Matma_Rex/brudnopis#cite_note-2" style="counter-reset: mw-Ref 2;" data-mw-group="a" id="mwCg"><span class="mw-reflink-text" id="mwCw">[a 2]</span></a></sup></span></li><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy" id="mwDA"></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">b</span></li></ol></div>

<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}" id="mwDQ"><ol class="mw-references references" id="mwDg"></ol></div>

The unnamed reference becomes the 2nd reference of the "a" ref list, but it should be a reference in the default ref list.


This affects real-world usage of {{efn}} on enwiki – I originally encountered the problem when using action=parsermigration-edit on some articles I recently edited, before reducing it to the test cases above:

(Timeless isn't relevant to the bug, but it handles super-wide pages better than Vector)

Event Timeline

matmarex renamed this task from List-defined nested references "inherit" the references lists' group name in Parsoid to List-defined nested references "inherit" the references list's group name in Parsoid.Oct 29 2023, 8:18 PM
Izno moved this task from Unsorted backlog to External on the Cite board.