]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix my broken fix
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 16:48:01 +0000 (12:48 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 16:48:01 +0000 (12:48 -0400)
IkiWiki/Plugin/map.pm

index 44fda73ca452e0bd11ad3f79d2738b19fca84e3f..4c2a15b019dab6fdab77ac9a3a7c5144ae5fe3d3 100644 (file)
@@ -88,6 +88,7 @@ sub preprocess (@) { #{{{
                        if defined $common_prefix && length $common_prefix;
                my $depth = ($item =~ tr/\//\//) + 1;
                my $baseitem=IkiWiki::dirname($item);
                        if defined $common_prefix && length $common_prefix;
                my $depth = ($item =~ tr/\//\//) + 1;
                my $baseitem=IkiWiki::dirname($item);
+               print STDERR "!! parent: $parent baseitem: $baseitem\n";
                while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
                        $parent=IkiWiki::dirname($parent);
                        last if !$dummy && length $parent && $baseitem =~ /^\Q$parent\E(\/|$)/;
                while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
                        $parent=IkiWiki::dirname($parent);
                        last if !$dummy && length $parent && $baseitem =~ /^\Q$parent\E(\/|$)/;
@@ -106,18 +107,19 @@ sub preprocess (@) { #{{{
                        }
                }
                my @bits=split("/", $item);
                        }
                }
                my @bits=split("/", $item);
+               my $p="";
+               $p.="/".shift(@bits) for 1..$indent;
                while ($depth > $indent) {
                        $indent++;
                        if ($indent > 1) {
                                $map .= "<ul>\n";
                        }
                        if ($depth > $indent) {
                while ($depth > $indent) {
                        $indent++;
                        if ($indent > 1) {
                                $map .= "<ul>\n";
                        }
                        if ($depth > $indent) {
-                               my $p="";
-                               $p.="/".shift(@bits) for 1..$indent;
-                               $p=~s/^\///;
+                               $p.="/".shift(@bits);
+                               #$p=~s/^\///;
                                $map .= "<li>"
                                        .htmllink($params{page}, $params{destpage},
                                $map .= "<li>"
                                        .htmllink($params{page}, $params{destpage},
-                                                "/".$common_prefix."/".$p, class => "mapparent",
+                                                "/".$common_prefix.$p, class => "mapparent",
                                                 noimageinline => 1)
                                        ."\n";
                                $openli=1;
                                                 noimageinline => 1)
                                        ."\n";
                                $openli=1;