Page MenuHomePhabricator

VisualEditor makes it easy to create partially linked words, when the user expects a fully linked one
Open, LowPublic

Description

In wikitext, [[foo]]bar will turn into <a href="foo">foobar</a> assuming bar matches the linktrail regexp, so it is very hard to end up with partially linked words (such as <a href="foo">foo</a>bar). VisualEditor on the other hand makes it easy, which is a problem as such partial linking conflicts with basically all style guides and usability guidelines, and also look ugly and confusing in wikitext ([[foo]]<nowiki/>bar or something like that).

There are two ways in which one can end up with such markup:

  • There is a linked word, and an editor tries to add a suffix to it (e.g. someone wants to edit [[word]] to become [[word]]s). VisualEditor offers a visual cue for this: when one is about to type a character which will be part of the link, the link is highlighted, otherwise it's not (and moving the cursor towards/away from the link can be used to switch between those states). While this sounds intuitive, in practice it seems that many editors (even experienced ones) fail to figure it out.
  • There is an unlinked word with a suffix, and someone wants to link it by selecting the word root and clicking on the link button (ie. they want to turn words into [[word]]s). This presumably seems more convenient than selecting the whole word and then deleting the suffix in the link dialog; but it ends up with VisualEditor only linking part of the word.

Unlinked characters at the end of a link are, as far as I know, never used. So VisualEditor makes it very easy to create misformatted text, while with the old editor it's practically impossible.

This is a major problem in agglutinative languages where suffixes are used a lot; on Hungarian Wikipedia most experienced editors refuse to use VisualEditor because of this (and the advice gets passed down in editathons and other outreach events, which impacts the ability of those events to quickly introduce newbies to editing). Seems to be a frequent issue elsewhere, too - see e.g. T35091, T53173, T54044, T95272 which are all about the same issue.

Maybe VisualEditor could automatically make linktrail characters part of the link as they are typed (in the ultra-rare case of not wanting that, the user can enter the trailing part as a separate word and then backspace it onto the link), or some kind of warning should be shown when one adds unlinked trailing characters.

(Originally reported at huwiki:Wikipédia:Kocsmafal_(egyéb)#VisualEditor-hibák)

Related Objects

Event Timeline

I need to make sure I understand what you are saying. It seems to me that there may be different outcomes,

  1. [[Hatvan|Hatvanban]] (ban is added later and becomes part of the wikilink)
  2. [[Hatvan]]<nowiki />ban
  3. [[Hatvan]]ban

Which one is the desirable one? It seems to me you are pointing toward #1?

The first and third form result the same rendered text, while at the second option the ban part will be unlinked.
Usually we used the 3rd form in wiki code: easier to write and it results simpler code.
If an article used the first form, bots (like AWB in the frame of general fixes) change to option 3.

See my comment here: https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia%3AKocsmafal_%28m%C5%B1szaki%29&type=revision&diff=17247830&oldid=17247648

[[Hatvan]]ban is maybe nicer than [[Hatvan|Hatvanban]] but there is little practical difference, and I imagine the first would be significantly more complex to implement.

I don't think the practical difference is all that matters, and I think we may want to solve this problem effectively also for other languages. See T128349 too.

Jdforrester-WMF renamed this task from VisualEditor: characters typed at the end of link should become part of it if they match the linktrail regexp to Come up with a design to make it easier for users to see that there is no space after a link (just the cartouche) and so you probably want to add one.Mar 7 2016, 8:43 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF updated the task description. (Show Details)
Tgr renamed this task from Come up with a design to make it easier for users to see that there is no space after a link (just the cartouche) and so you probably want to add one to VisualEditor: characters typed at the end of link should become part of it if they match the linktrail regexp.Jun 26 2018, 4:24 PM
Tgr updated the task description. (Show Details)

I've reverted the title and description of this task as it wasn't even remotely related to the issue it was originally about. In case someone wants to file a separate bug, here's the pre-revert version:

Come up with a design to make it easier for users to see that there is no space after a link (just the cartouche) and so you probably want to add one

The visual representation of <a href="foo">foo</a>bar is a bit too close to how <a href="foo">foo</a> bar should look. This leads to users creating odd edits which they almost certainly don't intend.

Tgr renamed this task from VisualEditor: characters typed at the end of link should become part of it if they match the linktrail regexp to VisualEditor makes it easy to create partially linked words, when the user expects a fully linked one.Jun 26 2018, 4:48 PM
Tgr updated the task description. (Show Details)

Part of the problem is that the construct of linking part of a word appears to be used in some wikis as a feature, such as the Basque Wikipedia. So, implementing this task might make things better for one group and worse for others.

I wonder if this really is intended this way on the Basque Wikipedia, though?

If I'm understanding correctly, this request centres around the complaint that wiki communities don't want people partially linking words or introducing this syntax. That's fair enough. However, people frequently do things in a good faith effort to improve things that wiki communities don't want them to do; the correct response is normally to tell the user what they've done wrong, why it's bad, and how to correct it, rather than using software to force conventions on people. I'm unconvinced that changing the visual editor is the correct solution to this, compared to the social solution of telling users that they should link the whole word. In fact, changing the link text and link target separately from each other in the visual editor will be easier soon, with T124305 now being fixed.

Now, as an aside... I did some research, and it's not really true that this syntax isn't used. Syntax like [[word]]<nowiki/>ending, to create a word that is partially linked, is used in over 2,000 pages on the Basque Wikipedia, and over 9,000 on the English Wikipedia. That said, it's debatable whether the user really intended to do it...

P.S. "It's over 9000!" joke not intended.

Whenever we talk about spaces what we actually mean is wordbreaks, however many languages (e.g. Chinese) don't have obvious word breaks (you could guess if you had a really good dictionary..), so any change here would definitely make things worse on those wikis.

Whenever we talk about spaces what we actually mean is wordbreaks, however many languages (e.g. Chinese) don't have obvious word breaks (you could guess if you had a really good dictionary..), so any change here would definitely make things worse on those wikis.

In T142927 I write that different languages may need different solutions.

Also, if some languages often need a way to separate linked text from non-linked text, it should not be done by <nowiki/>, which was not intended for this, but by some other element. <nowiki/> looks like a hack. And if they need it very often, they should completely disable trails.

Whenever we talk about spaces what we actually mean is wordbreaks, however many languages (e.g. Chinese) don't have obvious word breaks (you could guess if you had a really good dictionary..), so any change here would definitely make things worse on those wikis.

This is governed by $linkTrail in MessagesXx.php, so it shouldn't really be a concern for this task I think. At least for Chinese and Thai (the two I remember off the top of my head that don't use spaces), [[x]]y only puts the <a>­­ around x and not around xy.

Tgr moved this task from Backlog to Huwiki on the User-Tgr board.

In the german Wikipedia we have now many users of VisualEditor, thus this problem appears often and is often corrected via AWB. e.g. Diff
Here is a german discussion about this topic.

Can this bug been put at medium priority?