Page MenuHomePhabricator

Multiple pipe trick: [[Foo:Bar:Baz||]] = [[Foo:Bar:Baz|Baz]]
Closed, DeclinedPublic

Description

Author: ui2t5v002

Description:
Since the pipe trick doesn't get rid of all prepended words, multiple pipes
should get rid of multiple words, like so:

[[Wikipedia:en:Wikipedia:test]] --> Wikipedia:en:Wikipedia:test

[[Wikipedia:en:Wikipedia:test|]] --> en:Wikipedia:test

[[Wikipedia:en:Wikipedia:test||]] --> Wikipedia:test

[[Wikipedia:en:Wikipedia:test|||]] --> test

Not sure where in this heirarchy parenthetical expressions or section names
should be removed...


Version: unspecified
Severity: enhancement
URL: http://meta.wikimedia.org/wiki/Help_talk:Piped_link#Enhanced_pipe_trick

Details

Reference
bz3058

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:45 PM
bzimport set Reference to bz3058.
bzimport added a subscriber: Unknown Object (MLST).

This will cause too many problem with the parser. Such occurences
should use the proper syntax.

ui2t5v002 wrote:

(In reply to comment #1)

This will cause too many problem with the parser. Such occurences
should use the proper syntax.

Why?

The intended behavior, at least for my recent edits to the code (see bug 6826)
and, as far as I've been able to determine, for the original implementation as
well, is to strip all valid namespace and interwiki prefixes. Unfortunately,
this won't always work with stacked interwiki prefixes, for the simple reason
that, once MediaWiki encounters an interwiki prefix, it assumes that the rest of
the title is meant for the target wiki, which may have different namespaces and
interwiki prefixes, and thus can't be meaningfully parsed locally.

For example, consider this pathological link: [[meta:w:fr:ja:de:zh:fi:en:Main
Page]]. This will take you to [[Main Page]] on enwiki, but it'll need seven
HTTP redirects to get you there. What on earth should the parser make of such a
link, given that it may not know how all those other wikis are configured?

Seems the bugzilla parser just gave up on it. Oh well, you can always try the
URL directly: http://en.wikipedia.org/wiki/meta:w:fr:ja:de:zh:fi:en:Main_Page