X-Git-Url: https://scripts.mit.edu/gitweb/www/ikiwiki.git/blobdiff_plain/e25c3a0a7caa9783c657efe86611929ecb7bd4a3..810a355308d276ef922ff4312bff0c7935676633:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 5a05a0f73..4368870b8 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1,6 +1,7 @@ #!/usr/bin/perl package IkiWiki; + use warnings; use strict; use Encode; @@ -538,12 +539,7 @@ sub beautify_url ($) { #{{{ if ($config{usedirs}) { $url =~ s!/index.$config{htmlext}$!/!; } - - # Ensure url is not an empty link, and - # if it's relative, make that explicit to avoid colon confusion. - if ($url !~ /\//) { - $url="./$url"; - } + $url =~ s!^$!./!; # Browsers don't like empty links... return $url; } #}}}