Page MenuHomePhabricator

Add or move references on the visual editor creates superfluous wikitext or HTML markup (<span class="mw-reflink-text">)
Closed, DuplicatePublic1 Estimated 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

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.

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:

Capture d’écran_2017-04-20_14-47-48.png (82×1 px, 23 KB)

Even if you select the reference:

Capture d’écran_2017-04-20_15-12-36.png (261×1 px, 68 KB)

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

Capture d’écran_2017-04-20_15-13-58.png (118×297 px, 23 KB)
Capture d’écran_2017-04-20_15-14-24.png (204×536 px, 43 KB)

And when you save, it is ugly:

Capture d’écran_2017-04-20_15-18-50.png (88×1 px, 23 KB)

[[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.