From: Joey Hess Date: Fri, 28 Dec 2007 21:55:20 +0000 (-0500) Subject: * conditional: Improve regexp testing for simple uses of pagespecs X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/63f62ef52059c4acc1306e50dd32671a20bd9d55 * 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. --- diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index 2a25135fe..57db01054 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -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}, diff --git a/debian/changelog b/debian/changelog index aca79c6d1..c48d538e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 19 Dec 2007 16:39:07 -0500