Page MenuHomePhabricator

Discard broken pasted references from read mode on Parsoid HTML wikis
Open, Needs TriagePublic

Description

Issue

  1. Visit https://dag.wikipedia.org/wiki/Dagbamba
  2. Select and copy a reference in read mode
  3. Launch VE
  4. Paste the reference.
  5. Observe a reference is pasted, but it has no data - an error message states that the reference is defined in a template, and it serialises to an empty reference in wikitext </ref>

Backgorund
Currently references copied from read mode are discarded as they don't include enough information to rebuild the reference (they only contain <sup>[1]</sup>).

With the release of Parsoid HTML (e.g. on dag.wikipedia.org) we do know have the information available on the page, although a simple native browser copy will not work as the reference node itself only contains a pointer to the reference data, which is actually stored in the reference list.

Solutions
There are two options, we should probably do both in order

  1. (simple) Ensure that these 'broken' references are not pasted in VE, and instead are discarded. This maintains the status quo with references copied from legacy parser output.
  2. (harder) Add copy-handling code to read mode that ensures copied references are populated with their contents.

Event Timeline

Esanders renamed this task from Handle pasting references from read mode on Parsoid HTML wikis to Discard broken pasted references from read mode on Parsoid HTML wikis.Mar 20 2025, 5:53 PM

Change #1129902 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/Cite@master] Discard broken pasted references from Parsoid read mode

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

Change #1129902 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Discard broken pasted references from Parsoid read mode

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