[MKDoc-modules] [PATCH] Text::Structured space characters between blocks mess-up

Bruno Postle bruno at mkdoc.com
Fri Jul 16 10:41:13 BST 2004


On Tue 13-Jul-2004 at 12:26 +0100, Bruno Postle wrote:

>This chunk of text has a stray space in between text blocks, so the
>second part is rendered as <pre> text whereas it should be a
>continuation of the ordered-list:
>
>\r\n\r\n1. Some Text\r\n \r\n   Some more text\r\n\r\n2. Some Text

I added a test for this to CVS.

Here's a patch that passes all tests by removing trailing spaces 
before processing.

-- 
Bruno
-------------- next part --------------
Index: lib/MKDoc/Text/Structured.pm
===================================================================
RCS file: /var/spool/cvs/MKDoc-Text-Structured/lib/MKDoc/Text/Structured.pm,v
retrieving revision 1.16
diff -u -r1.16 Structured.pm
--- lib/MKDoc/Text/Structured.pm	12 Jul 2004 15:54:51 -0000	1.16
+++ lib/MKDoc/Text/Structured.pm	16 Jul 2004 09:40:52 -0000
@@ -37,6 +37,8 @@
     $text =~ s/\r\n/\n/gs;
     $text =~ s/\r/\n/gs;
 
+    # Trailing spaces -> fizzle!
+    $text =~ s/[\t ]+\n/\n/gs;
 
     my @lines   = split /\n/, $text;
     my @result  = ();


More information about the MKDoc-modules mailing list