From: Gavin Carr Date: Fri, 28 Sep 2007 10:37:00 +0000 (+0000) Subject: Update mason_blocks to use Blosxom::Debug. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=78220c4b565ce38f2df90b8f5e725950e11bbd40;p=matthijs%2Fupstream%2Fblosxom-plugins.git Update mason_blocks to use Blosxom::Debug. --- diff --git a/gavinc/mason_blocks b/gavinc/mason_blocks index 42dafa6..0155e80 100644 --- a/gavinc/mason_blocks +++ b/gavinc/mason_blocks @@ -1,15 +1,16 @@ # Blosxom Plugin: mason_blocks # Author(s): Gavin Carr -# Version: 0.002000 +# 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; @@ -141,12 +139,6 @@ in blosxom flavours/templates comment. - # Mason-style newline escaping, if last character on line is a backslash e.g. -

\ - Foo bar\ -

- # is rendered as:

Foo bar

- =head1 DESCRIPTION @@ -196,28 +188,6 @@ For example: Block comments cannot be nested. -=head2 NEWLINE ESCAPING - -mason_blocks also supports mason-style newline escaping i.e. if the last -character on a line is a backslash, mason_blocks escapes the line break, -deleting both the backslash and the following newline character(s). This -is useful in conjunction with conditionals where you'd prefer the -conditional content to appear inline within the enclosing content e.g. - - \ - % if ($feedback::count == 0) { - No Comments \ - % } - » - -would be rendered as: - - No Comments » - -This is not just a prettiness issue - some browsers treat embedded -whitespace (including newlines) as significant, even when they -shouldn't. - =head2 VS. INTERPOLATE_FANCY mason_blocks was initially born out of my frustration with older versions