This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In buildtoc, remove whitespace only lines just before output.
[perl5.git] / pod / buildtoc
index af9f525..e33118d 100644 (file)
@@ -406,6 +406,7 @@ EOPOD2B
   output $_;
   output "\n";                    # flush $LINE
 
+  $OUT =~ s/\n\s+\n/\n\n/gs;
   $OUT =~ s/\n{3,}/\n\n/g;
   open OUT, '>', $filename or die "$0: creating $filename failed: $!";
   print OUT $OUT;
@@ -505,7 +506,7 @@ sub output ($) {
            }
            $OUT .= $_;
        }
-       elsif (/\S/) {
+       else {
            $LINE .= $_;
        }
     }