[Moin-user] Replacing spaces in links after update
tw-public at gmx.de
Thu Jul 1 08:26:46 EDT 2010
> i updated from Version 1.5.X to 1.9.
Big changes in between (at 1.6).
> In the old wiki spaces in links were automatically replaced with '_'.
You mean that it replaced spaces in pagenames with _ in the links?
> This does not work anymore.
Yeah, it was crap. Back then, when that feature was added, I thought it
was a good idea (if mediawiki does it, it can't be wrong, right? :) to
map blank and underscore to underscore in URLs (and in page names).
The problem is that you afterwards don't know any more if it was
originally a blank or an underscore, which leads to problems with
externally given names (like attachment filenames [solvable, if you
rename the attachment or accept another name] or parts of the filesystem
made visible via the wiki [this works only with a special hack in moin
1.x, but will be a standard feature of moin2, and this could not be
solved with that magic in place]).
Thus, we had to revoke that "feature". Current behaviour is that you
just get what you have. If your pagename has a blank, you get a blank
(escaped to %20 in URLs), if your pagename has an underscore, you get an
underscore. No magic, no problems. :)
BTW, in the 1.5 -> 1.6 migration there is a step where you can rename
pages and files (rename1.txt) - this is mostly for that reason (we can't
decide automatically whether you rather want underscores or blanks in
So, in short, all magical replacing of some chars by others is gone in
current moin, with one small compatibility helper left:
If moin processes a request for a URL .../some_page, it will first look,
if there is a page called "some_page". If there is none, it will do a
second check for "some page". This is to make (old) links from outside
not break just because of underscore vs. blank.
> Is there any setting to use the old behavior?
No, we had to get rid of that troublemaker.
BTW, the usage of _ in older moins (< 1.6) was also caused by the bad
link markup, you could get into trouble with spaces easily or you were
forced to use more complicated link markup if you had a space in the
After 1.6 this is no issue any more, the new markup can link to [[stuff
with spaces]] easily.
Also, recent browsers are often not showing the quoted URLs any more,
but show the decoded form of them, e.g.:
http://.../foo bar < as shown by recent browsers
http://.../foo%20bar < as shown by older browsers
So the issue of "%20 is ugly" (which was another reason why we initially
mapped blank to underscore) is not that much an issue any more.
Just be careful when copy&pasting those URLs from browser's URL line to
other systems (like email or whatever), so that you get the quoted form
of the URL. For Firefox this is right-click into URL line, "select all",
More information about the Moin-user