# Blosxom Plugin: mason_blocks
# Author(s): Gavin Carr <gavin@openfusion.com.au>
-# 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
# --------------------------------
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;
}
}
+ # 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;