aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-01-13 11:02:11 +0100
committerJoey Hess <joey@kitenet.net>2012-01-13 13:42:38 -0400
commit17fb0cf9f9897121d9996e8c23ac0056d29acd7b (patch)
treea53fd6589a0d20cd9bfd72b0c631cb554aa78a58
parent08325b4da66d71f6c31cb269138c2ee4f279e786 (diff)
downloadikiwiki-17fb0cf9f9897121d9996e8c23ac0056d29acd7b.tar
ikiwiki-17fb0cf9f9897121d9996e8c23ac0056d29acd7b.tar.gz
backlink(.) should behave like backlink(<current page>)
Since commit c4d4cad3befbbd444d094cbeb0b6ebba3910a025, 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.
-rw-r--r--IkiWiki.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 08e242a1f..bc56501da 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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;
}