]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Add a fullpage arg to filter.
[ikiwiki.git] / IkiWiki.pm
index 35b38df46bbc4d71116c151688c34d982d24b34f..7b5fd283d6e09782c80f86361dd72e7b7b3fed72 100644 (file)
@@ -1074,6 +1074,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)
@@ -1099,7 +1106,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}) {
@@ -1389,14 +1396,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;