Page MenuHomePhabricator

Copy-pasting linked ISBN numbers from view mode HTML into VisualEditor inserts wikitext links to Special:BookSources (it should turn them into magic links?)
Open, LowPublic

Description

I was unable to find an existing bug for this, so I am filing a new one. This is either a VisualEditor or Citoid bug. Very occasionally, edits on en.WP tagged with "VisualEditor" are inserting a linked "ISBN" text followed by the ISBN value itself liked to Special:BookSources. This redundant linking is unnecessary. Here's a diff showing it happening:

https://en.wikipedia.org/w/index.php?title=Emperor_Jimmu&diff=next&oldid=795599385

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptAug 28 2017, 12:51 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Deskana triaged this task as Low priority.Aug 29 2017, 12:23 PM
Deskana changed the task status from Open to Stalled.
Deskana added a subscriber: Deskana.

What are the steps to reproduce this? I tried:

  • writing an ISBN by hand
  • copying and pasting an ISBN from another site
  • copying and pasting an ISBN in read mode from another article on-wiki
  • copying and pasting an ISBN in edit mode in VisualEditor from another article on-wiki

I thought one of the last two might be the culprit, since VisualEditor might try to be "smart" and explicitly copy the link to Special:BookSources, but actually it just did the right thing.

If this can't be reproduced, diagnosis will be hard.

I don't know how it's happening. Maybe the editor who created the diff above will know.

Mvolz added a subscriber: Mvolz.Aug 29 2017, 4:58 PM

I don't think this is a Citoid bug. These are bare references and citoid adds templates. And one of the ISBNs isn't even in worldcat which means citoid can't be used to add it anyway... maybe these were copy-pasted from somewhere?

Mvolz removed a project: Citoid.Aug 29 2017, 4:58 PM

This seems to have been copy-pasted from https://en.wikipedia.org/wiki/Nara_period#cite_note-2 (from the view mode, not from VE). I can reproduce the issue when doing this (I get wikitext like [[International Standard Book Number|ISBN]] [[Special:BookSources/978-1-59884-162-6|978-1-59884-162-6]]).

This is still happening, and gnomes need to clean up every time it happens. Can you please fix it? Here's one of the latest additions:

https://en.wikipedia.org/w/index.php?title=Redback_spider&type=revision&diff=806760513&oldid=806760142

You can see more of them here:

https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Check_Wikipedia/ISBN_errors

This is still happening, and gnomes need to clean up every time it happens. Can you please fix it? Here's one of the latest additions:

As noted above, I've been unable to reproduce this behaviour, and if it can't be reproduced then fixing it will probably be impossible.

matmarex renamed this task from VisualEditor (Citoid?) inserts Special:BookSources links when ISBN is added to Copy-pasting linked ISBN numbers from view mode HTML into VisualEditor inserts wikitext links to Special:BookSources (it should turn them into magic links?).Nov 7 2017, 11:06 PM
matmarex changed the task status from Stalled to Open.

Per my reproduction steps earlier (T174303#3562738).

Deskana moved this task from To Triage to Freezer on the VisualEditor board.Aug 31 2018, 10:54 AM

Can someone please fix this Visual Editor bug? It is causing gnomes to have to do unnecessary work. In an extreme example, this VE-using editor unwittingly added Special:BookSources links to 170+ articles on a single day:

https://en.wikipedia.org/w/index.php?limit=500&title=Special%3AContributions&contribs=user&target=Recensore256&namespace=&tagfilter=&start=2018-08-01&end=2018-08-01

Now all of those edits need to be fixed by a gnome. It sure would be better if this bug in VE were fixed. You can see many more examples of recent additions of Special:BookSources links here:

https://en.wikipedia.org/w/index.php?title=Wikipedia:WikiProject_Check_Wikipedia/ISBN_errors&curid=42611293&diff=857871061&oldid=855596578

This is not a rare occurrence.

I tested this again today, with this test page: https://en.wikipedia.org/w/index.php?title=User:Matma_Rex/sandbox&oldid=858044048. It seems @Deskana has already noticed and described this behavior above, but to re-state clearly:

  • Copy-pasting of ISBN links from view mode already works if they are generated using the magic link syntax, like ISBN 0-7475-3269-9
    • A bit surprisingly, it also works for manual links that mimic the output of magic links, like [[Special:BookSources/0747532699|ISBN 0-7475-3269-9]]
    • It does not work when the link target includes the extra separators, like [[Special:BookSources/0-7475-3269-9|ISBN 0-7475-3269-9]]
  • Copy-pasting of ISBN links from view mode does not work for the ISBN template, like {{ISBN|0-7475-3269-9}}
CaseInput wikitextOutput wikitext (after copy-pasting from view mode to VE)
Template{{ISBN|0-7475-3269-9}}[[International Standard Book Number|ISBN]] [[Special:BookSources/0-7475-3269-9|0-7475-3269-9]]
Template output[[International Standard Book Number|ISBN]] [[Special:BookSources/0-7475-3269-9 |0-7475-3269-9]][[International Standard Book Number|ISBN]] [[Special:BookSources/0-7475-3269-9|0-7475-3269-9]]
Magic linkISBN 0-7475-3269-9ISBN 0-7475-3269-9
Manual link 1[[Special:BookSources/0747532699|ISBN 0-7475-3269-9]]ISBN 0-7475-3269-9
Manual link 2[[Special:BookSources/0-7475-3269-9|ISBN 0-7475-3269-9]][[Special:BookSources/0-7475-3269-9|ISBN 0-7475-3269-9]]

@Jonesey95 If you wish to avoid the issue, convince the English Wikipedia community to change https://en.wikipedia.org/wiki/Template:ISBN so that it produces output similar to the "Manual link 1" case, rather than the current output ("Template output"). I'm actually surprised that it doesn't do that; all the links to https://en.wikipedia.org/wiki/International_Standard_Book_Number that it produces seem like a bad case of overlinking, anyway. Was that already proposed before and rejected?

Doing so will at least produce magic links on copy-paste from view mode to VisualEditor, rather than the messy syntax.

Producing the actual template when copy-pasted from view mode is currently impossible, because there is no data as to what template generated the text in the PHP parser's output. It will become possible in the future when we use Parsoid's output for view mode (T54091, T55784). You can see that output for my test page at https://en.wikipedia.org/api/rest_v1/page/html/User%3AMatma_Rex%2Fsandbox/858044048, and copy-pasting from there to VE works perfectly for all cases.


In short: We can't improve this behavior in VisualEditor, or not least not until far future. Instead, you can change Template:ISBN so that it copy-pastes better, but that has to be done by English Wikipedians rather than us.

Izno added a subscriber: Izno.EditedSep 7 2018, 4:28 PM

@Jonesey95 If you wish to avoid the issue, convince the English Wikipedia community to change https://en.wikipedia.org/wiki/Template:ISBN so that it produces output similar to the "Manual link 1" case, rather than the current output ("Template output"). I'm actually surprised that it doesn't do that; all the links to https://en.wikipedia.org/wiki/International_Standard_Book_Number that it produces seem like a bad case of overlinking, anyway. Was that already proposed before and rejected?

There's been some discussion of this here and there from an OLINK perspective, but what I've seen it would be replacing the wiki link with an external link + plainlink class applied, which would fix the WLH for the ISBN page but which isn't better for this particular task (I'd say worse, in fact).

On the point of whether that link should be there, the reason the link is desirable is so that people who don't know what an ISBN is can go and find out. This is the same for all of our identifier templates, in fact, so I would guess this issue can be observed with e.g. {{DOI}}.

The link to ISBN exists for a reason, as @Izno explains.

Meanwhile, this problem continues and copy-pasting (or something) appears to be generating superfluous span tags as well. See https://en.wikipedia.org/w/index.php?title=Virgil_Thomson&type=revision&diff=884836275&oldid=877453735

I wish the developers luck with fixing this annoying bug. In the meantime, it keeps us gnomes employed.

Per @Izno, this also appears to be happening with DOI and ISSN links. More junk for gnomes to clean up. See https://en.wikipedia.org/w/index.php?title=Purges_of_the_Communist_Party_of_the_Soviet_Union&diff=prev&oldid=884801720 for a sample diff.