From 9b10f5eab22be36cf3b3a217076c76a669b4aafa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 23 Aug 2008 13:10:49 -0400 Subject: map: The fix for #449285 was buggy and broke display of parents in certian circumstances. The use of $dummy was not sufficient, because it only stuck around for the first element after a dummy parent, and was then lost. Instead, use a $addparent that contains the actual dummy parent, so it can be compared with the new item to see if we're still under that parent or have moved to another one. --- IkiWiki/Plugin/map.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 4c2a15b01..18c584a30 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -80,7 +80,7 @@ sub preprocess (@) { #{{{ my $parent=""; my $indent=0; my $openli=0; - my $dummy=0; + my $addparent=""; my $map = "
\n\n"; } } - $dummy=0; while ($depth < $indent) { $indent--; $map .= "\n"; @@ -116,14 +115,14 @@ sub preprocess (@) { #{{{ } if ($depth > $indent) { $p.="/".shift(@bits); - #$p=~s/^\///; + $addparent=$p; + $addparent=~s/^\///; $map .= "
  • " .htmllink($params{page}, $params{destpage}, "/".$common_prefix.$p, class => "mapparent", noimageinline => 1) ."\n"; $openli=1; - $dummy=1; } else { $openli=0; -- cgit v1.2.3