summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2007-12-28 17:22:17 -0500
committerJoey Hess <joey@kitenet.net>2007-12-28 17:22:17 -0500
commit3e784ea8a1aeb41aa181c29b499cf76ab83dc6d0 (patch)
tree9aba1602658f98515eda1e582d1b8d7e27765f9d
parent191287b72fdd9db48e4ca937f6530015a7d1df91 (diff)
* map: Fix handling of common prefix to handle the case where it's
in a subdirectory. Patch by Larry Clapp.
-rw-r--r--IkiWiki/Plugin/map.pm3
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn2
3 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm
index 5b6af1f36..581ae5011 100644
--- a/IkiWiki/Plugin/map.pm
+++ b/IkiWiki/Plugin/map.pm
@@ -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;
}
diff --git a/debian/changelog b/debian/changelog
index c48d538e9..71119b3f5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn b/doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn
index 9436cbd0c..d6923605d 100644
--- a/doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn
+++ b/doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn
@@ -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]]