diff options
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 701f7137d..f9a30a202 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1081,6 +1081,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) @@ -1106,7 +1113,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}) { @@ -1396,14 +1403,16 @@ sub preprocess ($$$;$$) { return $content; } -sub filter ($$$) { +sub filter ($$$;$) { my $page=shift; my $destpage=shift; my $content=shift; + my $fullpage=shift; + $fullpage = 0 unless defined $fullpage; run_hooks(filter => sub { $content=shift->(page => $page, destpage => $destpage, - content => $content); + content => $content, fullpage => $fullpage); }); return $content; |