diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-27 21:38:02 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-27 21:38:02 +0000 |
commit | 5017ffd8a512c09d3c34764709791812acfc5515 (patch) | |
tree | 845afc1ef1a8de038c10c154f99b4099cf389ce3 /IkiWiki/Render.pm | |
parent | 06dc80b6625f2874ca8ad177306395dd01ef9c6a (diff) | |
download | ikiwiki-5017ffd8a512c09d3c34764709791812acfc5515.tar ikiwiki-5017ffd8a512c09d3c34764709791812acfc5515.tar.gz |
* Patch from Enrico that
- allows preprocessor directives to have parameters with no specified
value
- fixes preprocessor directive parameter parsing so that
foo=bar baz now means "foo=bar" and a "baz" with no value
- Add a tag plugin that allows more easily tagging pages.
The meta plugin can also still be used for this.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r-- | IkiWiki/Render.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e5a1679f8..690945c49 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -105,8 +105,13 @@ sub preprocess ($$;$) { #{{{ # Note: preserve order of params, some plugins may # consider it significant. my @params; - while ($params =~ /(\w+)=\"?([^"]+)"?(\s+|$)/g) { - push @params, $1, $2; + while ($params =~ /(?:(\w+)=)?(?:"([^"]+)"|(\S+))(?:\s+|$)/g) { + if (defined $1) { + push @params, $1, (defined $2 ? $2 : $3); + } + else { + push @params, (defined $2 ? $2 : $3), ''; + } } return $hooks{preprocess}{$command}{call}->(@params, page => $page); } |