tagging: Allow using titles in for related stories.
[matthijs/upstream/blosxom-plugins.git] / gavinc / mason_blocks
index 5a812d92a71a4434700934b98b86ec6e5ed56a89..0155e804eaa90bdcc78b19c33076aebf1bf346e8 100644 (file)
@@ -1,15 +1,16 @@
 # 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
 
 # --------------------------------
 
@@ -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;