diff options
author | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2008-12-21 15:23:59 +0000 |
---|---|---|
committer | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2008-12-21 15:23:59 +0000 |
commit | 0844bd0b1567404243d95e616d3c7526e922822d (patch) | |
tree | b0029810a0a5ceadbaa712f7d582f22c183c96fe | |
parent | 95b3bbbf7c786cc9e1dd7d7925ac75a0f525affd (diff) |
beautify_urlpath: add ./ before checking for /index.html
This fixes a bug: when a page links to its own #comments anchor you would
get a link like "index.html#comments" rather than "./#comments".
-rw-r--r-- | IkiWiki.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 47116089b..97c835cf6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -949,16 +949,16 @@ sub formattime ($;$) { sub beautify_urlpath ($) { my $url=shift; - if ($config{usedirs}) { - $url =~ s!/index.$config{htmlext}$!/!; - } - # Ensure url is not an empty link, and if necessary, # add ./ to avoid colon confusion. if ($url !~ /^\// && $url !~ /^\.\.\//) { $url="./$url"; } + if ($config{usedirs}) { + $url =~ s!/index.$config{htmlext}$!/!; + } + return $url; } |