diff options
author | Thomas Schwinge <thomas@schwinge.name> | 2010-11-25 14:18:54 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2010-11-25 14:18:54 +0100 |
commit | fe368cda90cd374c68780c238481b1208056655f (patch) | |
tree | 1ee9a3a6c1b49862cd7d836f9e4049a6f1658b81 /.library/IkiWiki/Plugin/ymlfront.pm | |
parent | adf6755da0ed4a18fee1d7f871ea307043d72620 (diff) | |
download | web-fe368cda90cd374c68780c238481b1208056655f.tar.gz web-fe368cda90cd374c68780c238481b1208056655f.tar.bz2 web-fe368cda90cd374c68780c238481b1208056655f.zip |
Update to b329454a41390ca8b3f31215d62542a27e6a8b80 of <git://github.com/rubykat/ikiplugins.git>.
Diffstat (limited to '.library/IkiWiki/Plugin/ymlfront.pm')
-rw-r--r-- | .library/IkiWiki/Plugin/ymlfront.pm | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/.library/IkiWiki/Plugin/ymlfront.pm b/.library/IkiWiki/Plugin/ymlfront.pm index 3811591b..6af4e5d6 100644 --- a/.library/IkiWiki/Plugin/ymlfront.pm +++ b/.library/IkiWiki/Plugin/ymlfront.pm @@ -10,11 +10,11 @@ IkiWiki::Plugin::ymlfront - add YAML-format data to a page =head1 VERSION -This describes version B<0.03> of IkiWiki::Plugin::ymlfront +This describes version B<1.20100808> of IkiWiki::Plugin::ymlfront =cut -our $VERSION = '0.03'; +our $VERSION = '1.20101116'; =head1 PREREQUISITES @@ -52,6 +52,31 @@ sub import { } # ------------------------------------------------------------ +# Package Vars +# -------------------------------- +my $ymlfront_regex = qr{ + (\\?) # 1: escape? + \[\[(!) # directive open; 2: prefix + (ymlfront) # 3: command + ( # 4: the parameters.. + \s+ # Must have space if parameters present + (?: + (?:[-\w]+=)? # named parameter key? + (?: + """.*?""" # triple-quoted value + | + "[^"]*?" # single-quoted value + | + [^"\s\]]+ # unquoted value + ) + \s* # whitespace or end + # of directive + ) + *)? # 0 or more parameters + \]\] # directive closed + }sx; + +# ------------------------------------------------------------ # Hooks # -------------------------------- sub getsetup () { @@ -300,27 +325,6 @@ sub parse_yml { } elsif ($content) { - my $regex = qr{ - (\\?) # 1: escape? - \[\[(!) # directive open; 2: prefix - (ymlfront) # 3: command - ( # 4: the parameters.. - \s+ # Must have space if parameters present - (?: - (?:[-\w]+=)? # named parameter key? - (?: - """.*?""" # triple-quoted value - | - "[^"]*?" # single-quoted value - | - [^"\s\]]+ # unquoted value - ) - \s* # whitespace or end - # of directive - ) - *)? # 0 or more parameters - \]\] # directive closed - }sx; my $ystart = $config{ymlfront_delim}[0]; my $yend = $config{ymlfront_delim}[1]; if ($ystart eq '---' @@ -335,7 +339,7 @@ sub parse_yml { $yml_str = $2; $rest_of_content = $1 . $3; } - elsif ($content =~ /$regex/) + elsif ($content =~ $ymlfront_regex) { my $escape=$1; my $prefix=$2; |