Last modified: 2010-05-15 15:33:11 UTC
According to the documentation at http://meta.wikimedia.org/wiki/Templates#External_links when a template parameter is part of a URL, any spaces in the value of the parameter are automatically converted to %20 so that the URL is properly rendered, i.e. the URL is not ended. However, the examples contained in the documentation demonstrate that this automatic conversion does _not_ in fact happen--at least in the version of MediaWiki on which the documentation is running.
I'm not sure who wrote that or why, it doesn't seem to be true and I'd be very surprised if it were. Tested on 1.3.8 and 1.4 current. Marking... invalid? Not sure. Reopen if you get more information.
According to the Meta home page it is running 1.4beta3. Maybe I am retarded or just sleep-deprived, but did you check out the link in the bug description? The documentation expressly states that: "A blank space in a parameter value or template content that is substituted in a URL is not taken as ending the URL, but converted to %20." But look at the first example in the "Examples" section that follows this statement. It passes the parameters: insert in target insert in label to the template: tle The template tle is defined as follows: [http://a{{{1}}}b c{{{2}}}d] Now, according to the documentation, this should render HTML that looks like this: <a href="http://ainsert%20in%20targetb">cinsert in labeld</a> But the html that gets rendered is not even close; it is this: <a href="http://ainsert">in targetb cinsert in labeld</a> This is cleary caused by the space chars in the first parameter "insert in target" NOT being replaced by % 20's as they should be and as the documentation claims they are.
(In reply to comment #2) > Maybe I am retarded or just sleep-deprived, but did you check out the link in the bug description? The > documentation expressly states that: I certainly did: as I explained, this "documentation" does not match the observed behavior of the system. I confirmed also that the observed behavior on 1.4beta3 is the same on 1.3.8. From this I draw the conclusion that the page's description probably was not correct before the upgrade either. I therefore cannot explain why someone wrote that description. We will require additional information, such as a confirmation that it really did ever work like that.
Oh, I must be sleep-deprived...when you said, "I don't know who wrote that...", I thought you were talking about me logging this as a bug. One this is for sure: It sure would be nice if space chars were converted to %20 in URLs. This would make the templating functionality a lot more useful. See the OtherVersionsExt template embedded on this page: http://217.160.248.24/randy/wikibible/mediawiki-1.3.7/index.php?title=WikiBibleMerge:Bible_Versions for an example of where this would be really useful and why I want to use it. The workaround is that I have to pass two params--one with spaces, one with %20s.
The template replacement doesn't know that you're putting something into a URL. Resolving as a duplicate of bug 839, an enhancement request for an explicit way to URL-encode things like template parameters. *** This bug has been marked as a duplicate of 839 ***