aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-01-13 11:13:34 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-01-13 11:13:34 +0100
commit08325b4da66d71f6c31cb269138c2ee4f279e786 (patch)
treed3ad4ce97a2806b373cc5eb7f6973ec4b424d69f /doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn
parent18a40243a18306d97051bd26a47887ea04679bed (diff)
downloadikiwiki-08325b4da66d71f6c31cb269138c2ee4f279e786.tar
ikiwiki-08325b4da66d71f6c31cb269138c2ee4f279e786.tar.gz
Propose patch to fix backlink(.)
Diffstat (limited to 'doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn')
-rw-r--r--doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn b/doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn
index ede1d2fe3..cb7f156bc 100644
--- a/doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn
+++ b/doc/bugs/backlink__40__.__41___doesn__39__t_work.mdwn
@@ -10,3 +10,47 @@ page):
tested with 3.20120109.
— [[Jon]]
+
+> The attached patch should fix it:
+
+
+ From 30512ac5f6a724bafb1095ab246e0648999f7b6c Mon Sep 17 00:00:00 2001
+ From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+ Date: Fri, 13 Jan 2012 11:02:11 +0100
+ Subject: [PATCH] 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.
+ ---
+ IkiWiki.pm | 10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+ diff --git a/IkiWiki.pm b/IkiWiki.pm
+ index 08e242a..bc56501 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;
+ }
+
+ --
+ 1.7.8.rc2.253.gdbf3
+
+
+> (you need to re-make IkiWiki for it to work)