Page MenuHomePhabricator

Ugly wrapping of link cartouches
Open, LowestPublic8 Estimated Story Points


Link cartouches (implemented in ) can wrap in an ugly way, with the cartouche opening just before the line end. This doesn't seem to impact on functionality.

pasted_file (153×571 px, 27 KB)

Event Timeline

dchan claimed this task.
dchan raised the priority of this task from to Low.
dchan updated the task description. (Show Details)

Change 233740 had a related patch set uploaded (by Divec):
WIP POC: Fix wrapping glich with temporary block style

Esanders set Security to None.

The changeset works but has certain side effects (see commit message). We should decide:

  1. Whether there's a less kludgy way
  2. If not, whether it's worth merging (i.e. whether the benefits outweigh the cost).

I can't think of anything for (1) and I'm not really sure about (2) - anyone else have an opinion?

Occurred to me that this is very related to T126487.

The patch here impacts the behavior in that bug, such that cursoring down past a link at the start of the line captures the cursor for one press, but lets it go afterwards, which is an improvement. However, it adds a new quirk, which is that cursoring up past the line-starting-link switches the cursor to the end of future lines.

Change 233740 abandoned by Jforrester:
WIP: Fix cartouche wrapping glitch with temporary block style on img

Jdforrester-WMF lowered the priority of this task from Low to Lowest.May 19 2017, 10:36 AM
Jdforrester-WMF removed a project: Patch-For-Review.
Aklapper added a subscriber: dchan.

Resetting assignee as it does not seem like @dchan is actively working on this task (feel free to correct me).

@matmarex coded the approach of styling the link node with "white-space: no-wrap", then adding an inner span styled as "white-space: normal". See here:

This fixes the cartouche wrapping glitch, but creates a different glitch, whereby typing at the start of the link in Chromium results in text that is outside the inner span, and so doesn't wrap. This is temporary: it's fixed automatically on re-render and saves correctly.

This glitch is more significant than the cartouche wrapping glitch, but would happen more rarely, so we can decide which behaviour we prefer.

Glitch behaviour for the 754986 option