Page MenuHomePhabricator

Pasting a diff in the "wikipedia link" tab changes this link
Closed, ResolvedPublic

Description

Steps:

Expectation:

  • the link is from Wikipedia, do I'm supposed to keep this link as it is

Reality:

  • the link is striped of everything but the page title
  • you have to guess that you should use the "External link" to paste this diff - it is confusing

Event Timeline

Change 583616 had a related patch set uploaded (by Sohom Datta; owner: Sohom Datta):
[mediawiki/extensions/VisualEditor@master] Treat links to diffs as external links

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

I see this has been marked for inclusion in Tech News. Please ping me when you know when it will go into production.

We should bear in mind that in the article namespace on Wikipedia it is almost always incorrect to link to a diff or history page, so it may be the case that this logic is prevent people from creating "bad" links when copying and pasting.

In what circumstances are you trying to create a diff link within VE?

We currently have a config for stripping external links (VisualEditorAllowExternalLinkPaste) although it is not enabled on any wikis. We also allow other VE integrations (e.g. Flow) to disable external link stripping.

In what circumstances are you trying to create a diff link within VE?

I don't remember the exact circumstances, but you can find plenty of pages outside of namespace where you may need to paste a diff, like help pages or project pages. Or Flow posts.

I agree on th fact that diffs or other special links aren't welcomes within ns:0-Main. However, you have other pages, and there, the logic behind the two tabs may not be clear for everyone:

PurposeUnderstanding
Wikipedia tabsimple links to Wikipedia pagesAny link under the wikipedia.org namespace
External link tabany other link, that starts with http or httpsAny link that is not on Wikipedia

I was conflating the two places people can paste a link

  1. in the surface directly
  2. in the link inspector

As this patch only affects (2) then there's no real problem. My comments apply to (1) and we should address this separately.

The patch affects both, although the problematic one to change the behaviour for is (1).

the logic behind the two tabs may not be clear for everyone:

Yes, the labels don't quite work in this edge case. They were chosen to be most easily understood by newcomers, so changing them to be more precise may not be the best option overall.

@Esanders The change in the behavior is correct in both situations.

When you paste some HTML containing a red link from read mode into the editor, it should come out as a link to that article (that was fixed by the patch for T239550, causing this bug in turn).

When you paste some HTML containing a link to https://en.wikipedia.org/w/index.php?title=Adelaide_Lightning&diff=920856050&oldid=920804628, ideally it would come out as a link to that, less ideally it will come out as no link at all because we think it's external (this will be the case after the patch), but it's definitely wrong for it to come out as a link to the article's view mode (this is the current behavior).

(I don't think this requires an announcement, it's a small bug fix.)

Change 583616 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Treat links to diffs and history pages as external links

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