Page MenuHomePhabricator

Dirty diff when saving a self-closing ref tag, it sometimes becomes a tag with empty content
Closed, ResolvedPublicBUG REPORT

Description

We seem to have some glitch in Cite or its Parsoid support, which causes a tag like <ref ... /> to be saved as <ref ...></ref>.

Steps to reproduce:

  • Create an article with a template-defined main ref and a sub-reference in the article referring to this ref. For example,
<ref name="main" details="p.123" />

{{reflist|refs=
<ref name="main">Main body</ref>
}}
  • Make a change to the article in visual editor, unrelated to the references, and save.

What happens:

  • The ref tag becomes <ref name="main" details="p.123"></ref>

What should have happened:

  • No change to the ref tag.

Event Timeline

awight changed the subtype of this task from "Task" to "Bug Report".May 8 2026, 8:23 AM

Change #1285825 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Don't send mainBodyHtml when InternalItem is empty

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

The fix leads to this change, which is also an edge case.

image.png (1,294×554 px, 42 KB)

Change #1285825 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Don't send mainBodyHtml when InternalItem is empty

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