diff options
author | intrigeri <intrigeri@boum.org> | 2010-01-09 22:53:45 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-01-09 22:53:45 +0100 |
commit | 88c6e2891593fd508701d728602515e47284180c (patch) | |
tree | b7374971bac5de6644ccc09159e8f5772d349d2c /IkiWiki.pm | |
parent | dca9634202d9ab28c524068e17928f403ec03a2c (diff) | |
download | ikiwiki-88c6e2891593fd508701d728602515e47284180c.tar ikiwiki-88c6e2891593fd508701d728602515e47284180c.tar.gz |
moved selflink test to its own isselflink (overridable) sub
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 9 |
1 files changed, 8 insertions, 1 deletions
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 "<span class=\"selflink\">$linktext</span>" - if length $bestlink && $page eq $bestlink && + if length $bestlink && isselflink($page, $bestlink) && ! defined $opts{anchor}; if (! $destsources{$bestlink}) { |