X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ad8cb6d6fafa77be4e97a983d1b209f79aaf65ac..1e01ec26fe6d6d179934bfa69a55eaaf1a184464:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index fa49b2c34..0c0b7bd4c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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 "$linktext" - if length $bestlink && $page eq $bestlink && + if length $bestlink && isselflink($page, $bestlink) && ! defined $opts{anchor}; if (! $destsources{$bestlink}) {