Page MenuHomePhabricator

VE correctly shows sub-refs when the main content is only referenced by name
Closed, ResolvedPublic

Description

User story:

As VE user I want to be able to correctly see sub-refs when the content is only referenced by name in Wikitext.

Acceptance criteria:
<ref name="book">Miller 2025</ref>
<ref name="book" details="page 1" />

Shows two refs in VE [1] and [1.1] both can be edited individually.

Implementation

There's a parser test at the moment that currently documents the broken state Parent reference used before sub-reference
This can be run by

./modules/mediawiki/bin/mwscript tests/parser/parserTests.php --wiki=dev --file=/srv/docker-dev/mediawiki/extensions/Cite/tests/parser/subReferencing.txt --filter "Parent reference used before sub-reference"
  • Make the test expect the output needed ( in that case a valid main and subref )
  • Fix the test by implementing the needed behavior in References.php in the Parsoid code

( Currently we only look at refs that have main and sub content in the tag, so we split them to create an "artificial" main ref. In this usecase that split does not need to happen, because the main ref is already its own reference )

Notes

Probably needs to be solved in Parsoid first the output there is also not correct yet.
For EditMode check ve-cite/dm and ce files , find extends usages and change to details

Outcome

<ref name="book">Miller 2025</ref>
<ref name="book" details="page 1" />

<ref name="book2" details="page 2"> Miller 2022</ref>

image.png (554×796 px, 33 KB)

Event Timeline

Change #1129826 had a related patch set uploaded (by Mareike Heuer; author: Mareike Heuer):

[mediawiki/extensions/Cite@master] [WIP] Show correct subref index Parsoid

https://gerrit.wikimedia.org/r/1129826

Change #1130077 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] Demo for T389098

https://gerrit.wikimedia.org/r/1130077

Change #1130077 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Cite@master] [POC] Demo for T389098

https://gerrit.wikimedia.org/r/1130077

MareikeHeuerWMDE updated Other Assignee, removed: lilients_WMDE.
MareikeHeuerWMDE subscribed.

Change #1129826 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Show correct subref index Parsoid

https://gerrit.wikimedia.org/r/1129826

awight moved this task from Demo to Done on the WMDE-TechWish-Sprint-2025-03-19 board.