Last modified: 2014-04-17 19:48:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44986, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42986 - Automatically convert external links to local resources to local wiki links if possible
Automatically convert external links to local resources to local wiki links i...
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Lowest enhancement
: ---
Assigned To: Gabriel Wicke
:
: 57019 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-12 07:47 UTC by Liangent
Modified: 2014-04-17 19:48 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Comment 1 James Forrester 2012-12-12 20:12:39 UTC
Ask, or just silently replace? But then it will 'dirty diff' if this has been done deliberately. Also, to do this, link inspector will need to have a concept of canonical URLs and optional other URLs for this context, which is messy as hell.
Comment 2 Matthew Flaschen 2013-06-15 01:04:17 UTC
Sometimes it is done deliberately, e.g. at https://en.wikipedia.org/w/index.php?title=English_Wikipedia&oldid=558847653 .  In that case, they do use olids (permalinks), which is a way you could distinguish if you wanted to do the auto-replacement.
Comment 3 James Forrester 2013-06-16 22:13:29 UTC
(In reply to comment #2)
> Sometimes it is done deliberately, e.g. at
> https://en.wikipedia.org/w/index.php?title=English_Wikipedia&oldid=558847653
> . 
> In that case, they do use olids (permalinks), which is a way you could
> distinguish if you wanted to do the auto-replacement.

We could do an always-replace for [http://foo/wiki/* $1], but that feels like a fragile regexp. :-(
Comment 4 Jarry1250 2013-06-30 16:39:23 UTC
Seeing a few of these in the feed. Warn, perhaps? (In the link inspector dialog.)
Comment 5 Elitre 2013-08-21 14:14:14 UTC
I'd go for "prevent". (Also, it would be really nice to have it soon).
Comment 6 Sage Ross 2013-08-23 17:08:16 UTC
I think maybe it should just recognize when a url points to an existing Wikipedia article, and offer that as an internal link option, similarly to the way that you get an internal link option for the article titled [[http://en.wikipedia.org/wiki/foo]]. That latter behavior represents a tiny edge case, though, as there are very few articles that start with http://. If there is ever going to be some sort of 'advanced' mode for links, then options to use external links to existing articles and internal links to articles starting http* should be hidden away there. In the vast majority of cases, users intend to create internal links if the article exists, and do not intend to create internal links to pages starting http*.

Incidentally, we want to add the same functionality to the EducationProgram extension for when users paste in a url to the article form: bug 44397.
Comment 7 Elitre 2014-03-24 17:43:19 UTC
Also, when users create a new article and want to link back to it immediately, they end up attaching "?venotify=created" to the external link they're copy/pasting, and this is something VE will need to strip before converting the URL to a wikilink.
Comment 8 James Forrester 2014-04-16 18:37:27 UTC
Feels like this has consensus that we should convert newly-added [http://en.wikipedia.org/wiki/foo] links to [[foo]] automatically; I think that this should be done inside Parsoid, so moving there.
Comment 9 Liangent 2014-04-17 10:20:19 UTC
(In reply to James Forrester from comment #8)
> Feels like this has consensus that we should convert newly-added
> [http://en.wikipedia.org/wiki/foo] links to [[foo]] automatically; I think
> that this should be done inside Parsoid, so moving there.

But only for VisualEditor edits? if Parsoid is going to be used in other stuff eg. bots.
Comment 10 James Forrester 2014-04-17 13:42:41 UTC
(In reply to Liangent from comment #9)
> (In reply to James Forrester from comment #8)
> > Feels like this has consensus that we should convert newly-added
> > [http://en.wikipedia.org/wiki/foo] links to [[foo]] automatically; I think
> > that this should be done inside Parsoid, so moving there.
> 
> But only for VisualEditor edits? if Parsoid is going to be used in other
> stuff eg. bots.

No, all edits - this is the same as [http://fr.wikipedia.org/wiki/Foo Bar] being automatically converted by Parsoid to [[:fr:Foo|Bar]] which it already does.
Comment 11 Liangent 2014-04-17 13:57:42 UTC
(In reply to James Forrester from comment #10)
> No, all edits - this is the same as [http://fr.wikipedia.org/wiki/Foo Bar]
> being automatically converted by Parsoid to [[:fr:Foo|Bar]] which it already
> does.

I feel there're still some deliberate use cases of external local links, for example, to prevent Echo notifications (see [[Template:Noping]]).
Comment 12 James Forrester 2014-04-17 17:36:18 UTC
(In reply to Liangent from comment #11)
> (In reply to James Forrester from comment #10)
> > No, all edits - this is the same as [http://fr.wikipedia.org/wiki/Foo Bar]
> > being automatically converted by Parsoid to [[:fr:Foo|Bar]] which it already
> > does.
> 
> I feel there're still some deliberate use cases of external local links, for
> example, to prevent Echo notifications (see [[Template:Noping]]).

Users making hacks around bugs in Echo sounds like something we should fix in Echo so users don't have to do it, though. :-)
Comment 13 James Forrester 2014-04-17 19:48:25 UTC
*** Bug 57019 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links