my $depth = ($item =~ tr/\//\//) + 1;
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
my $depth = ($item =~ tr/\//\//) + 1;
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
$p.="/".shift(@bits);
$map .= "<li>"
.htmllink($params{page}, $params{destpage}, $p, class => "mapparent")
$p.="/".shift(@bits);
$map .= "<li>"
.htmllink($params{page}, $params{destpage}, $p, class => "mapparent")
$map .= "<li>"
.htmllink($params{page}, $params{destpage},
"/".$common_prefix."/".$item, class => "mapitem")
$map .= "<li>"
.htmllink($params{page}, $params{destpage},
"/".$common_prefix."/".$item, class => "mapitem")