Page MenuHomePhabricator

External link check should ignore links to Sister Projects
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

What happens?:

image.png (553×1 px, 98 KB)

What should have happened instead?:
No check shown.

Event Timeline

That's only true for Wiktionary and Wikisource per https://en.wikipedia.org/wiki/MOS:INTERWIKI – and other projects are even more restrictive and prohibit any interwiki links in the article body (except for sections like "external links"), e.g. https://de.wikipedia.org/wiki/Wikipedia:Verlinken#ANR or https://pt.wikipedia.org/wiki/WP:NOIW. And if projects allow interwiki links in certain circumstances, they should be formatted like that instead of using the external link format.

There are a number of open tasks around interwiki support that make this non-trivial: T322340. In this case it is that interwiki links are considered external links by VE, it is only Parsoid that simplifies them down.

We could look into adding per-wiki config for which types of interwikis are not allowed, but for now we can just allow all interwikis and focus on true external links.

Change #1223153 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] ExternalLinksEditCheck: Exclude interwiki links

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

There are a number of open tasks around interwiki support that make this non-trivial: T322340. In this case it is that interwiki links are considered external links by VE, it is only Parsoid that simplifies them down.

We could look into adding per-wiki config for which types of interwikis are not allowed, but for now we can just allow all interwikis and focus on true external links.

@Esanders, to be doubly sure I'm following, it sounds like you're saying:

  1. VE is not currently able to distinguish a "genuine" external link from a link to a sister project.
  2. For now, let's suppress any kind of "External link" suggestion from appearing for links to sister projects

...although, "1." and "2." intuitively seem in tension with one another leading me to think I'm missing/misunderstanding something.

An interwiki link is a special case of a normal internal wiki link, using a special prefix that signifies that it's not really a link inside the current wiki. E.g. [[fr:Pomme]] which gets expanded to https://fr.wikipedia.org/wiki/Pomme. For VisualEditor there's not a difference in generated HTML between the interwiki [[fr:Pomme]] and the external [https://fr.wikipedia.org/wiki/Pomme Pomme], because Parsoid turns "interwiki" links into external links to provide to VE, and then converts external links that are to sister projects back into interwiki links when we send that link back.

So we can't tell whether a user really wrote the markup for an external link or just used the interwiki shortcodes, but we can tell whether a link is to a site that has an interwiki code.

Change #1223153 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ExternalLinksEditCheck: Exclude interwiki links

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

Per today's offline discussion, and by extension, David merging 1223153, the MVP of the the external link suggestion will NOT appear for links to any sister projects, regardless of how said links were created.[i]


i. E.g. by way of someone explicitly typing en:Lemon or https://en.wikipedia.org/wiki/lemon and Parsoid converting this link into the en... form.