Page MenuHomePhabricator

Facilitate editing the text of a link (especially adding text to the beginning/end of it)
Closed, ResolvedPublic

Description

Given a link to lemon (created automatically when adapting the text or previously by the user) it is hard to edit its text to become lemons. The problem is that the "s" normally gets added after the link (resulting into [[ https://en.wikipedia.org/wiki/Lemon | lemon ]]s). This forces users to do workarounds to avoid this issue.

In order to solve this, we can do the following:

By default, make any text written next to the link become part of the link unless the user starts typing a space (or the cursor arrow, esc key or tab key). We can communicate that visually by making the link underline to extend below the cursor caret unless the user cancels it (in the ways described before: space, esc key, etc.).

In addition, we can consider providing extra padding for link elements when they are selected so that it makes it easy to click at the end of the link or outside of it, but this may be problematic since making some pieces of text to grow in width can cause an alignment glitch.

Some technical limitations from the use of contentEditable may limit the possible solutions.

This was reported here, and here, and we have observed the issue on several testing sessions.

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedPginer-WMF
ResolvedNone
ResolvedAmire80
InvalidNone
ResolvedPginer-WMF
DeclinedNone
Resolved Petar.petkovic
Resolved Petar.petkovic
Resolved Petar.petkovic
ResolvedPginer-WMF
OpenNone
Resolved Petar.petkovic
Resolved Petar.petkovic
Resolved Petar.petkovic
ResolvedPginer-WMF
Resolvedsanthosh
Resolveddchan
Resolvedsanthosh
Resolvedsanthosh
ResolvedNikerabbit
OpenNone
Resolvedsanthosh
ResolvedPginer-WMF
OpenNone
ResolvedPginer-WMF
InvalidNone
Resolved Petar.petkovic
Resolvedsanthosh
Resolvedsanthosh

Event Timeline

Pginer-WMF raised the priority of this task from to Needs Triage.
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF added a subscriber: Pginer-WMF.
santhosh triaged this task as Medium priority.Mar 27 2015, 11:34 AM
santhosh added a subscriber: santhosh.

The problem is that the "s" normally gets added after the link

This behaves correctly in Firefox. If you move your cursor from left to right, you can add s inside link(<a>) tag. If you move cursor from right to end of lemon, s is inserted outside

Same behavior happens with CX Content editable and VE

Amire80 raised the priority of this task from Medium to High.Aug 5 2015, 8:06 AM

This is a deceptively complex problem, made more so by various browser issues around selection placement. We have a solution in VE now (two cursor positions at the edge of the links).

Pginer-WMF claimed this task.

This is already supported in CX2, a major refactoring and architectural update of Content Translation to integrate the same editing surface as VisualEditor. Currently it can be tested by adding &version=2 to the URL of the translation editor (still experimental), and will become the default version in the future.

For further work on link manipulation (such as the tickets mentioned in T93854#1893842 ) once they are supported in VisualEditor, the improvements will also apply to Content Translation.