From 0844bd0b1567404243d95e616d3c7526e922822d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Dec 2008 15:23:59 +0000 Subject: 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". --- IkiWiki.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'IkiWiki.pm') 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; } -- cgit v1.2.3