Page MenuHomePhabricator

Transform link labels of interwikis on paste
Open, Needs TriagePublic

Description

MediaWiki allows us to define interwiki links, even to non wikis, such as [[meta:Foo]] or [[phab:T999]].

If I paste a link to Phab into VE, Parsoid will eventually detect that it can be converted to an interwiki, but VE doesn’t know about interwikis and will set the link label to the full URL on paste, so you will end up with [[phab:T999|https://phabricator.wikimedia.org/T999]].

Observed
Pasting a Phab link into VE results in [[phab:T999|https://phabricator.wikimedia.org/T999]]

Expected
Pasting a Phab link into VE results in [[phab:T999]] or [[phab:T999|T999]]

This would match the behaviour of internal link pasting. If I paste a link to https://en.wikipedia.org/wiki/Cat into an article on en.wiki, the link title gets truncated to "Cat", such that the wikitext is just [[Cat]],