X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/bd7221ae5450e14e9641e01e0c2890a8f018ddb4..c99d26030e6ddd7a21932e98e40a8df7d896886d:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 35b38df46..f9a30a202 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -441,6 +441,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + wrapper_background_command => { + type => "internal", + default => '', + description => "background shell command to run", + safe => 0, + rebuild => 0, + }, gettime => { type => "internal", description => "running in gettime mode", @@ -1074,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) @@ -1099,7 +1113,7 @@ sub htmllink ($$$;@) { } return "$linktext" - if length $bestlink && $page eq $bestlink && + if length $bestlink && isselflink($page, $bestlink) && ! defined $opts{anchor}; if (! $destsources{$bestlink}) { @@ -1389,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;