Reputation: 1556
In a wikipedia's article text, a link might be mentioned like: [Category:A B C], however the exact wiki url will have suffix like Category:A_B_C From where I can get the information regarding all these rules which wiki uses to get the url from a link in its text ?(, e.g. converting spaces to underscores, capitalizing first letter, dealing with non-ascii characters etc)
Upvotes: 0
Views: 79
Reputation: 3547
Roughly the following:
category:
--> Category:
.Category:foo
--> Category:Foo
. Note: this depends on wiki settings and titles are never uppercased on Wiktionary, for example.Foo bar
--> Foo_bar
.urlencode()
, except for the following ones: ;:@$!*(),/
.For full technical details you could look up this (function getLocalUrl()) and this (function wfUrlencode()).
Upvotes: 2
Reputation: 244878
There is no “etc.”, you already mentioned all the rules:
Note that rules #1 and #2 are not mandatory: if you create your own URL that doesn't follow them, Wikipedia will still show the page correctly.
Things get more complicated if you include namespace aliases (WP:WikiProject Computing
→ Wikipedia:WikiProject_Computing
) and interwiki links (wikia:gameofthrones:Westeros
→ http://www.wikia.com/wiki/c:gameofthrones:Westeros
).
Upvotes: 0