diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-08 10:03:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-08 10:03:55 -0400 |
commit | e25c3a0a7caa9783c657efe86611929ecb7bd4a3 (patch) | |
tree | 96dadbde10a8341f10f5e60f4b692fe4c889365a /IkiWiki.pm | |
parent | 42dcf37016fb79ce31e63e8683ad614413d29414 (diff) | |
download | ikiwiki-e25c3a0a7caa9783c657efe86611929ecb7bd4a3.tar ikiwiki-e25c3a0a7caa9783c657efe86611929ecb7bd4a3.tar.gz |
Fix a bug with links to pages whose names contained colons.
So the problem is that ikiwiki would generate a relative link like
href="colon:problem", which web browsers treat as being in the "colon:"
uri scheme.
The best fix seems to be to make url beautification fix this, by slapping
a "./" in front.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 0b420e824..5a05a0f73 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -538,7 +538,12 @@ sub beautify_url ($) { #{{{ if ($config{usedirs}) { $url =~ s!/index.$config{htmlext}$!/!; } - $url =~ s!^$!./!; # Browsers don't like empty links... + + # Ensure url is not an empty link, and + # if it's relative, make that explicit to avoid colon confusion. + if ($url !~ /\//) { + $url="./$url"; + } return $url; } #}}} |