Page MenuHomePhabricator

Edit check proposal: Detect when a multi-word link is fragmented
Closed, ResolvedPublic

Description

It is possible in the course of visual editing to accidentally create two separate links that are identical.

Example: "Birmingham Moor Street" in the lede section: https://simple.wikipedia.org/w/index.php?title=Birmingham_Snow_Hill_railway_station&oldid=10844969&veaction=edit

This also triggers the "duplicate link check" which can be confusing for editors, as it isn't clear there are two links there. See this bug report: https://www.mediawiki.org/wiki/Talk:VisualEditor/Suggestion_Mode/Feedback#c-Crazywork-20260504123100-duplicateLink_on_Birmingham_Snow_Hill_railway_station_at_simplewiki

Event Timeline

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

[mediawiki/extensions/VisualEditor@master] DuplicateLinkEditCheck: Suggest merging links when adjacent

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

The above patch adds a special case to the duplicate link check that shows if the dupicate links are adjacent or separated by only whitespace. The messages change and the 'delete' action becomes 'merge':

image.png (315×258 px, 22 KB)

Change #1283699 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] DuplicateLinkEditCheck: Suggest merging links when adjacent

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

It is possible in the course of visual editing to accidentally create two separate links that are identical.

BTW, is there a ticket for automatically merging such links in VisualEditor? It feels like something VE should fix by itself.

image.png (1,640×584 px, 646 KB)

image.png (938×480 px, 177 KB)

Switches between duplicate and merge, depending on whether distance between links satisfies adjacency

image.png (3,424×502 px, 199 KB)