]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
releasing version 3.20100722
[ikiwiki.git] / IkiWiki.pm
index fa49b2c340fe9b40f46db39a42c0d084b1fcd4f1..0c0b7bd4c0d418fffda7b2d86623c7c967e82e37 100644 (file)
@@ -911,7 +911,7 @@ sub will_render ($$;$) {
        if (-d _) {
                foreach my $p (keys %renderedfiles, keys %oldrenderedfiles) {
                        foreach my $f (@{$renderedfiles{$p}}, @{$oldrenderedfiles{$p}}) {
-                               if ($f eq dirname($dest) || dirname($f) eq $dest) {
+                               if (dirname($f) eq $dest) {
                                        unlink("$config{destdir}/$f");
                                        rmdir(dirname("$config{destdir}/$f"));
                                }
@@ -1118,6 +1118,15 @@ sub urlto ($$;$) {
        return beautify_urlpath($link);
 }
 
+sub isselflink ($$) {
+       # Plugins can override this function to support special types
+       # of selflinks.
+       my $page=shift;
+       my $link=shift;
+
+        return $page eq $link;
+}
+
 sub htmllink ($$$;@) {
        my $lpage=shift; # the page doing the linking
        my $page=shift; # the page that will contain the link (different for inline)
@@ -1143,7 +1152,7 @@ sub htmllink ($$$;@) {
        }
        
        return "<span class=\"selflink\">$linktext</span>"
-               if length $bestlink && $page eq $bestlink &&
+               if length $bestlink && isselflink($page, $bestlink) &&
                   ! defined $opts{anchor};
        
        if (! $destsources{$bestlink}) {