]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix off-by-one, and fix link
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 16:37:19 +0000 (12:37 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 16:37:19 +0000 (12:37 -0400)
The link was broken if the inserted dir was not under the destpage

IkiWiki/Plugin/map.pm

index 429493b9ef4f9b61cd0fd354d25772cd155ecf7c..44fda73ca452e0bd11ad3f79d2738b19fca84e3f 100644 (file)
@@ -113,11 +113,11 @@ sub preprocess (@) { #{{{
                        }
                        if ($depth > $indent) {
                                my $p="";
-                               $p.="/".shift(@bits) for 1..$indent+1;
+                               $p.="/".shift(@bits) for 1..$indent;
                                $p=~s/^\///;
                                $map .= "<li>"
                                        .htmllink($params{page}, $params{destpage},
-                                                $p, class => "mapparent",
+                                                "/".$common_prefix."/".$p, class => "mapparent",
                                                 noimageinline => 1)
                                        ."\n";
                                $openli=1;