backlink(.) should behave like backlink(<current page>)

Since commit c4d4cad3be, the single dot in
a pagespec can be used to mean the current page. While this worked
correctly in link() it didn't work in backlink(). Fix this by explicitly
checking the testpage in backlink against . and replacing it with the
current location if necessary.
master
Giuseppe Bilotta 2012-01-13 11:02:11 +01:00 committed by Joey Hess
parent 08325b4da6
commit 17fb0cf9f9
1 changed files with 8 additions and 2 deletions

View File

@ -2647,8 +2647,14 @@ sub match_link ($$;@) {
}
sub match_backlink ($$;@) {
my $ret=match_link($_[1], $_[0], @_);
$ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
my $page=shift;
my $testpage=shift;
my %params=@_;
if ($testpage eq '.') {
$testpage = $params{'location'}
}
my $ret=match_link($testpage, $page, @_);
$ret->influences($testpage => $IkiWiki::DEPEND_LINKS);
return $ret;
}