summaryrefslogtreecommitdiff
path: root/doc/plugins/map
diff options
context:
space:
mode:
authorharishcm <harishcm@web>2009-07-20 10:40:29 -0400
committerJoey Hess <joey@kitenet.net>2009-07-20 10:40:29 -0400
commit3fef1fbd0d555497988e719a680be38df11a5397 (patch)
tree70153c770ed924375b03c77ce8a1bf30dc4e16ac /doc/plugins/map
parent9fb0d03c5a964f2ee2c062ffb4a88969345cfb72 (diff)
Issue with ul and div tag closure when returning empty map
Diffstat (limited to 'doc/plugins/map')
-rw-r--r--doc/plugins/map/discussion.mdwn23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/plugins/map/discussion.mdwn b/doc/plugins/map/discussion.mdwn
index c724a6492..c031ab14c 100644
--- a/doc/plugins/map/discussion.mdwn
+++ b/doc/plugins/map/discussion.mdwn
@@ -18,3 +18,26 @@ We'd also very much like to have an option to display the title of the page inst
There's a patch implementing this in [[!debbug 484510]]. It needs a few fixes
before I merge it. Now applied. --[[Joey]]
+
+----
+
+I noticed that when the pagespec returns no map items, the map plugin does not close off the ul and div tags. Below is a simple patch
+that seems to work on the examples I tried. I am a beginner so please help me out here. Thanks. --[[harishcm]]
+
+ --- a/map.pm
+ +++ b/map.pm
+ @@ -81,6 +81,13 @@
+ my $openli=0;
+ my $addparent="";
+ my $map = "<div class='map'>\n<ul>\n";
+ +
+ + # Return properly closed $map if %mapitems is empty
+ + if (!scalar(keys %mapitems)) {
+ + $map .= "</ul>\n</div>\n";
+ + return $map;
+ + }
+ +
+ foreach my $item (sort keys %mapitems) {
+ my @linktext = (length $mapitems{$item} ? (linktext => $mapitems{$item}) : ());
+ $item=~s/^\Q$common_prefix\E\///
+