Page MenuHomePhabricator

VisualEditor: Link creation should not include trailing spaces, and should provide a suggestion based on selected text
Closed, ResolvedPublic

Description

When creating a new link on a selected text, the target should be the selected text by default; it is currently empty.

Also, if trailing spaces are selected, links will be generated "[[like|this ]]" instead of "[[like|this]] ".


Version: unspecified
Severity: enhancement

Details

Reference
bz33053

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:07 AM
bzimport set Reference to bz33053.

In the first case, once we tie in an ajax page lookup we will provide suggestions to make this simpler. I think pre-filling it with the text you selected is potentially confusing, but we will be making sure you don't have to type it twice if it's already a wiki page.

It's important to consider also that not every word should be linked the page with the same title. This is especially clear with words that have extensive disambiguation pages. It's a better approach to suggest some likely page titles based on the selected text.

In the case of including the space, it does seem like a place where we can help the user make a cleaner edit by automatically adjusting the selection to not include any leading or trailing spaces. This could be a feature enhancement bug on it's own.

Mockup of disambiguation suggestions

Title suggestions on disambiguation definitely sound like a nice idea. Maybe something like this.

Attached:

Screen_Shot_2011-12-13_at_6.09.11_PM.png (729×1 px, 327 KB)

Something along those lines - however it's not just the fact that there's a disambiguation page there. In many cases there are just multiple articles by essentially the same title that are about completely different things. For instance, if you were linking the text "The Little Prince", that would take you to the article on the book. The disambiguation page is located at "Little Prince" so you wouldn't have hit that. But what if you meant to link to the film ("The Little Prince (film)"), the play ("The Little Prince (play)"), or the opera ("The Little Prince (opera)").

The correct behavior should be to offer suggestions, much like we do with our search suggestions (and probably using the same API) based on the selected text.

(In reply to comment #0)

Also, if trailing spaces are selected, links will be generated "[[like|this ]]"
instead of "[[like|this]] ".

Just a note: the behavior described at
https://www.mediawiki.org/w/index.php?title=Visual_editor/Feedback&oldid=552919#Double_click_selects_spaces
makes it very common to have spaces in the end of the selected text.

(In reply to comment #4)

Just a note: the behavior described at

bug 33108

The first request seems to be the same as bug 33108 (Highlighted trailing whitespace should not have styles applied).

The second one seems to be the same as bug 37491 (Link box should suggest page titles)

Mass-moving items into VisualEditor product

Mass-move out of "General" to "User Interface".