Page MenuHomePhabricator

VE: Empty body in sub-ref breaks preview and interaction in VE (edge case)
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Add Wikitext like
<ref name="book">Miller</ref>
<ref details="page 1" name="book"></ref>
  • Open VE

What happens?:

  • Instead of the subref content VE shows

This reference is defined in a template or other generated block, and for now can only be edited in source mode.
in the references list and the context preview.

Screenshot From 2025-05-19 09-39-48.png (1,437×282 px, 47 KB)

  • When you switch back to wikitext content is lost

Screenshot From 2025-05-19 09-41-51.png (1,805×258 px, 61 KB)

What should have happened instead?:

Should show page 1 as expected

Event Timeline

Lina_Farid_WMDE renamed this task from VE: Empty content on a sub-ref breaks preview and interaction in VE to VE: Empty main ref content with a sub-ref breaks preview and interaction in VE.May 19 2025, 7:42 AM
Lina_Farid_WMDE updated the task description. (Show Details)

Confirmed broken. And if the empty main is given as a self-closing tag then no issue occurs:

<ref name="book">Miller</ref>
<ref details="page 1" name="book" />
Lina_Farid_WMDE renamed this task from VE: Empty main ref content with a sub-ref breaks preview and interaction in VE to VE: Empty main ref content with a sub-ref breaks preview and interaction in VE (edge case).Jun 4 2025, 3:27 PM
lilients_WMDE renamed this task from VE: Empty main ref content with a sub-ref breaks preview and interaction in VE (edge case) to VE: Empty body in sub-ref breaks preview and interaction in VE (edge case).Jul 2 2025, 9:49 AM

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

[mediawiki/extensions/Cite@master] Fix VE meta data for sub-ref with empty main content slot

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

Change #1165853 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Fix VE meta data for sub-ref with empty main content slot

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

WMDE-Fisch claimed this task.

Seems resolved.