Link cartouches (implemented in https://gerrit.wikimedia.org/r/217257/ ) can wrap in an ugly way, with the cartouche opening just before the line end. This doesn't seem to impact on functionality.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
WIP: Fix cartouche wrapping glitch with temporary block style on img | VisualEditor/VisualEditor | master | +60 -2 |
Related Objects
Event Timeline
Change 233740 had a related patch set uploaded (by Divec):
WIP POC: Fix wrapping glich with temporary block style
The changeset https://gerrit.wikimedia.org/r/233740 works but has certain side effects (see commit message). We should decide:
- Whether there's a less kludgy way
- 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
Resetting assignee as it does not seem like @dchan is actively working on this task (feel free to correct me).
See also, not sure if related: T134571: Link cartouches interfere with browsers' word break algorithms
@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: https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/754986/
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.