From: intrigeri Date: Sat, 9 Jan 2010 21:53:45 +0000 (+0100) Subject: moved selflink test to its own isselflink (overridable) sub X-Git-Tag: 3.20100722~8^2~8^2~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=88c6e2891593fd508701d728602515e47284180c;p=ikiwiki.git moved selflink test to its own isselflink (overridable) sub --- diff --git a/IkiWiki.pm b/IkiWiki.pm index b8e599928..5d5c7f0d0 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1026,6 +1026,13 @@ sub urlto ($$;$) { return beautify_urlpath($link); } +sub isselflink ($$) { + 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) @@ -1051,7 +1058,7 @@ sub htmllink ($$$;@) { } return "$linktext" - if length $bestlink && $page eq $bestlink && + if length $bestlink && isselflink($page, $bestlink) && ! defined $opts{anchor}; if (! $destsources{$bestlink}) {