]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
* map: Fix handling of common prefix to handle the case where it's
authorJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2007 22:22:17 +0000 (17:22 -0500)
committerJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2007 22:22:17 +0000 (17:22 -0500)
  in a subdirectory. Patch by Larry Clapp.

IkiWiki/Plugin/map.pm
debian/changelog
doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn

index 5b6af1f36f6ce0c6cc9605365ed491d123d09efd..581ae5011f8a002190f133f6ce999797bae43b1b 100644 (file)
@@ -37,6 +37,9 @@ sub preprocess (@) { #{{{
                                my @b=split(/\//, $common_prefix);
                                $common_prefix="";
                                while (@a && @b && $a[0] eq $b[0]) {
+                                       if (length $common_prefix) {
+                                               $common_prefix.="/";
+                                       }
                                        $common_prefix.=shift(@a);
                                        shift @b;
                                }
index c48d538e9958860a43e3f1eebdb7bbe5872b689e..71119b3f5c150b90e883d253c27950e7579d5263 100644 (file)
@@ -7,6 +7,8 @@ ikiwiki (2.17) UNRELEASED; urgency=low
   * conditional: Improve regexp testing for simple uses of pagespecs
     that match only the page using the directive, adding 'included()'
     and supporting negated pagespecs and added whitespace.
+  * map: Fix handling of common prefix to handle the case where it's
+    in a subdirectory. Patch by Larry Clapp.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 19 Dec 2007 16:39:07 -0500
 
index 9436cbd0c5d560d847c6ba56be742c339c9f200d..d6923605d157fce7551959874191c4d5277aaeba 100644 (file)
@@ -66,3 +66,5 @@ Note that you you don't get "blog" or "tags", and "life" and "tech" are links no
 Map tries to calculate a "common prefix" between the pagespec and the page being rendered, and then later does some substitutions using the prefix.  But the path has /'s in it and the common prefix doesn't, so it never matches correctly.  So, add the /'s.
 
 -- [[users/Larry_Clapp]]
+
+> Excellent problem description and analysis. Patch [[applied|done]] --[[Joey]]