Page MenuHomePhabricator

Trim whitespace in LinkTargetInputWidget
Closed, ResolvedPublic1 Estimated Story Points

Description

When you paste something like "\thttp://example.com " (a tab, then a URL, then a space) into the link inspector, we should do something so we don't end up trying to create an internal link whose target starts with a tab, because that will upset Parsoid (see T93045).

I'm not quite sure what we should do here. Automagically trim whitespace somehow?

Event Timeline

Catrope raised the priority of this task from to Needs Triage.
Catrope updated the task description. (Show Details)
Catrope subscribed.

Change 200804 had a related patch set uploaded (by Catrope):
Trim whitespace from link targets

https://gerrit.wikimedia.org/r/200804

Change 200804 merged by jenkins-bot:
Trim whitespace from link targets

https://gerrit.wikimedia.org/r/200804

Change 201895 had a related patch set uploaded (by Esanders):
Don't use a inputFilter on LinTargetInputWidget

https://gerrit.wikimedia.org/r/201895

Roan's fix introduces a worse bug which is that spaces get stripped as soon as they are typed, so you can't type "Main Page" for example. The commit above fixes that.

Change 201895 merged by jenkins-bot:
Don't use a inputFilter on LinkTargetInputWidget

https://gerrit.wikimedia.org/r/201895

Change 204077 had a related patch set uploaded (by Catrope):
Don't use a inputFilter on LinkTargetInputWidget

https://gerrit.wikimedia.org/r/204077

Change 204077 merged by jenkins-bot:
Don't use a inputFilter on LinkTargetInputWidget

https://gerrit.wikimedia.org/r/204077

Good thing we fixed the horrible breakage (for which we had T95646 filed in the meantime), but in the process we regressed the fix. in VE-MW, pasting http://example.com/ (with spaces) into the link inspector will result in red, internal link, starting with a space and ending with a space.

This is back to being fixed (through refusal to insert).