X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom-plugins.git;a=blobdiff_plain;f=gavinc%2Fmason_blocks;h=0155e804eaa90bdcc78b19c33076aebf1bf346e8;hp=5a812d92a71a4434700934b98b86ec6e5ed56a89;hb=HEAD;hpb=bd9159478d7ddb7505b3574db7287d2940f2afc4 diff --git a/gavinc/mason_blocks b/gavinc/mason_blocks index 5a812d9..0155e80 100644 --- a/gavinc/mason_blocks +++ b/gavinc/mason_blocks @@ -1,15 +1,16 @@ # Blosxom Plugin: mason_blocks # Author(s): Gavin Carr -# Version: 0.001000 +# Version: 0.002001 package mason_blocks; use strict; +#use Blosxom::Debug debug_level => 1; + # --- Configurable variables ----- -# Debug verbosity -my $debug_level = 0; +# None # -------------------------------- @@ -77,10 +78,7 @@ sub munge_blocks { my $else = pop @else; my $if_block = pop @if_blocks; my $else_block = pop @else_blocks; - warn "end_block: if '$if', if block " . - scalar(@$if_block) . " lines, else block " . - scalar(@$else_block) . " lines\n" - if $debug_level; + # debug(1, "end_block: if '$if', if block " . scalar(@$if_block) . " lines, else block " . scalar(@$else_block) . " lines\n"); # Check condition, and replace current line with appropriate flattened block if (eval "$if") { $_ = join "\n", @$if_block; @@ -101,7 +99,11 @@ sub munge_blocks { } } + # Join flavour lines and update $$flavour_ref $$flavour_ref = join "\n", @flavour; + + # Support mason-style end-of-line newline escapes + $$flavour_ref =~ s/\\\r?\n//g; } 1;