Page MenuHomePhabricator

Add or move references on the visual editor creates superfluous wikitext or HTML markup (<span class="mw-reflink-text">)
Closed, DuplicatePublic1 Estimate Story Points


This bug is a long-time investigation from fr.wp users. We don't manage to find a reason, or don't manage to reproduce it.

Some people (probably) move references in articles, generating superfluous wikitext and addition of <span class="mw-reflink-text">, like in

there is other cases on

Looks similar to T139268: CX2: Citations templates are sometimes translated to useless markup (or empty) without content or T100532: VE keeps moving comma with comment in newline.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 3 2017, 10:23 AM
Jdforrester-WMF triaged this task as High priority.Apr 4 2017, 7:14 PM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Izno moved this task from Unsorted backlog to External on the Cite board.Apr 11 2017, 7:35 PM

I've manged to reproduce this bug while writing an article: I've simply copy a reference to reuse it and pasted it at the "wrong" place, in the link label.

How to: on an article already containing references, copy one reference. Then, paste the reference after a link, inside of the blue background that symbolized the link label (the one that I didn't paid attention to).

It looks normal in editing mode:

Even if you select the reference:

But is it not normal when you hover the link or select the label:

And when you save, it is ugly:

[[Lanneuffret|Lanneuffret<ref name=":1" />]]<span class="mw-reflink-text"><nowiki>[2]</nowiki></span>

I've also copied the bad code on my sandbox, which has generated a worse result:

[[Lanneuffret|Lanneuffret<ref name=":1">{{Article|langue=|auteur1=[[Yves-Pascal Castel]]|titre=CAST - Église Saint-Jérôme - Croix de procession, {{s-|XVII}}|périodique=[[Société archéologique du Finistère]]|volume=CXLIV|date=2016|issn=|lire en ligne=|pages=50-55}}</ref>]]<span class="mw-reflink-text"><nowiki>[3]</nowiki></span>[[Undefined|<span class="mw-reflink-text">[2]</span>]][[Croix de procession de Cast#cite note-:1-2|<span class="mw-reflink-text">[2]</span>]]<span class="mw-reflink-text"><nowiki>[2]</nowiki></span>.

It also works for references that are only used once: create the reference somewhere, then cut it and paste it the same way.

If you create a new reference while the blue link label is active the problem (hopefully) doesn't happen.