From b8ce93b8a63d4a20f1e6abe9661c46b41bcc0ea1 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 21 Jan 2011 15:00:19 +0000 Subject: [PATCH] In buildtoc, call Text::Wrap::wrap() just before output. Previously output() wrapped as it went along. This change renders output() vestigial. --- pod/buildtoc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pod/buildtoc b/pod/buildtoc index e33118d..182de56 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -408,6 +408,9 @@ EOPOD2B $OUT =~ s/\n\s+\n/\n\n/gs; $OUT =~ s/\n{3,}/\n\n/g; + + $OUT =~ s/([^\n]+)/wrap('', '', $1)/ge; + open OUT, '>', $filename or die "$0: creating $filename failed: $!"; print OUT $OUT; close OUT; @@ -495,21 +498,8 @@ sub unitem { $initem = 0; } -my $LINE; # what remains to be printed - sub output ($) { - for (split /(\n)/, shift) { - if ($_ eq "\n") { - if ($LINE) { - $OUT .= wrap('', '', $LINE); - $LINE = ''; - } - $OUT .= $_; - } - else { - $LINE .= $_; - } - } + $OUT .= shift; } # End of original buildtoc. From here on are routines to generate new sections -- 2.7.4