]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
* conditional: Improve regexp testing for simple uses of pagespecs
authorJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2007 21:55:20 +0000 (16:55 -0500)
committerJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2007 21:55:20 +0000 (16:55 -0500)
  that match only the page using the directive, adding 'included()'
  and supporting negated pagespecs and added whitespace.

IkiWiki/Plugin/conditional.pm
debian/changelog

index 2a25135fe31757ed06c21f211bab6a7d2ea79414..57db010544b52d436e7dac2ed42e34ef80445360 100644 (file)
@@ -24,7 +24,7 @@ sub preprocess_if (@) { #{{{
                # An optimisation to avoid needless looping over every page
                # and adding of dependencies for simple uses of some of the
                # tests.
-               $params{test} =~ /^(enabled|sourcepage|destpage)\((.*)\)$/) {
+               $params{test} =~ /^\s*\!?\s*(enabled|sourcepage|destpage|included)\((.*)\)\s*$/) {
                add_depends($params{page}, "$params{test} and $params{page}");
                $result=pagespec_match($params{page}, $params{test},
                                location => $params{page},
index aca79c6d151a2473e23f49a62d3f19df53a89c93..c48d538e9958860a43e3f1eebdb7bbe5872b689e 100644 (file)
@@ -4,6 +4,9 @@ ikiwiki (2.17) UNRELEASED; urgency=low
   * redir: Support for specifying anchors.
   * img: Avoid nesting images when linking to another image. Closes: #457780
   * img: Allow the link parameter to point to an exterior url.
+  * 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.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 19 Dec 2007 16:39:07 -0500