]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
more
[ikiwiki.git] / IkiWiki.pm
index eb003a1fb9992e940dec64d2a315cca4260307c2..c078a005515c1a3dd7cfd49e8553956b3348da2b 100644 (file)
@@ -407,6 +407,7 @@ sub bestlink ($$) { #{{{
                # absolute links
                $cwd="";
        }
+       $link=~s/\/$//;
 
        do {
                my $l=$cwd;
@@ -513,7 +514,9 @@ sub displaytime ($;$) { #{{{
 sub beautify_url ($) { #{{{
        my $url=shift;
 
-       $url =~ s!/index.$config{htmlext}$!/!;
+       if ($config{usedirs}) {
+               $url =~ s!/index.$config{htmlext}$!/!;
+       }
        $url =~ s!^$!./!; # Browsers don't like empty links...
 
        return $url;
@@ -541,6 +544,7 @@ sub htmllink ($$$;@) { #{{{
        my $page=shift; # the page that will contain the link (different for inline)
        my $link=shift;
        my %opts=@_;
+
        $link=~s/\/$//;
 
        my $bestlink;
@@ -560,7 +564,8 @@ sub htmllink ($$$;@) { #{{{
        }
        
        return "<span class=\"selflink\">$linktext</span>"
-               if length $bestlink && $page eq $bestlink;
+               if length $bestlink && $page eq $bestlink &&
+                  ! defined $opts{anchor};
        
        if (! $destsources{$bestlink}) {
                $bestlink=htmlpage($bestlink);