Subject: | Pod::Text shows wrong intendation in verbatim text in a line that follows a line with spaces only |
Date: | Tue, 13 Jan 2009 17:47:55 +0100 |
To: | bug-podlators [...] rt.cpan.org |
From: | Renée Bäcker <renee.baecker [...] smart-websolutions.de> |
Hi,
this mail is related to #62062 in perl RT
(http://rt.perl.org/rt3/Public/Bug/Display.html?id=62062).
If you have something like this in your Pod:
text
line1
line3
Then Pod::Text does this (if MARGIN is 4):
text
line1
line3
The attached patch fixes that.
Cheers,
Renee
--- D:\Perl510\lib\Pod\Text.pm.orig 2009-01-13 17:32:44.000000000 +0100
+++ D:\Perl510\lib\Pod\Text.pm 2009-01-13 17:05:10.000000000 +0100
@@ -346,7 +346,7 @@
my ($self, $attrs, $text) = @_;
$self->item if defined $$self{ITEM};
return if $text =~ /^\s*$/;
- $text =~ s/^(\n*)(\s*\S+)/$1 . (' ' x $$self{MARGIN}) . $2/gme;
+ $text =~ s/^(\n*)([ \t]*\S+)/$1 . (' ' x $$self{MARGIN}) . $2/gme;
$text =~ s/\s*$/\n\n/;
$self->output ($text);
return '';