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


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.

Pginer-WMF updated the task description. (Show Details)
Pginer-WMF raised the priority of this task from to Needs Triage.
Pginer-WMF added a subscriber: Pginer-WMF.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 25 2015, 7:22 AM
santhosh triaged this task as Normal 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

He7d3r added a subscriber: He7d3r.
Arrbee moved this task from Needs Triage to CX5 on the ContentTranslation board.Apr 10 2015, 9:51 AM
Amire80 set Security to None.
Amire80 moved this task from Backlog to Links on the ContentTranslation-Release6 board.
Pginer-WMF updated the task description. (Show Details)Jun 19 2015, 7:46 AM
Amire80 moved this task from CX5 to CX6 on the ContentTranslation board.Jul 2 2015, 4:34 PM
Pginer-WMF moved this task from CX6 to CX7 on the ContentTranslation board.Jul 21 2015, 5:56 PM
Amire80 raised the priority of this task from Normal 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).

Elitre added a subscriber: Elitre.Feb 8 2016, 7:01 PM
MGChecker added a subscriber: MGChecker.
Dvorapa removed a subscriber: Dvorapa.Jun 20 2016, 10:15 AM
Pginer-WMF closed this task as Resolved.Mar 16 2018, 10:57 AM
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.