From a54a9f2e25c347b0abd434e3481c3e701aac7c2e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Dec 2007 00:24:01 -0500 Subject: web commit by http://theclapp.myopenid.com/: create bug --- ...e___34__common__95__prefix__34___correctly.mdwn | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..2d06b0a57 --- /dev/null +++ b/doc/bugs/map_doesn__39__t_calculate___34__common__95__prefix__34___correctly.mdwn @@ -0,0 +1,68 @@ +Problem with [[plugins/map]]: + +# Observed behavior: + +## given map: + +\[[map pages="blog/tags/*"]] + +## received map: + +
+ +
+ +Note that you get "blog" and "tags", and they're both links, but "life" and "tech" are not links. + +# desired output: + +
+ +
+ +Note that you you don't get "blog" or "tags", and "life" and "tech" are links now. + +# patch which appears to achieve this: + +
+--- map.pm.orig 2007-11-23 16:04:02.000000000 -0500
++++ map.pm      2007-12-21 00:12:15.000000000 -0500
+@@ -37,6 +37,9 @@
+                                my @b=split(/\//, $common_prefix);
+                                $common_prefix="";
+                                while (@a && @b && $a[0] eq $b[0]) {
++                                       if ($common_prefix) {
++                                         $common_prefix .= "/";
++                                       }
+                                        $common_prefix.=shift(@a);
+                                        shift @b;
+                                }
+
+ +# Discussion + +(Disclaimer: I don't know ikiwiki internals.) + +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. + +-- Larry Clapp, -- cgit v1.2.3