diff options
author | Russ Allbery <eagle@eyrie.org> | 2007-09-19 04:09:34 +0000 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2007-09-19 04:09:34 +0000 |
commit | 810776191dbb1c0d6f8443ef4cd030b2adfd70e5 (patch) | |
tree | 1bb8ab31257ae7392f62a5baf47d1dcb62183cc3 | |
parent | 81fc0683c6dc4103c427772363c6396981a1b891 (diff) |
Drop blank lines at the start of a parsed section and don't treat blank
lines at the start of text as another paragraph. Thanks to Benjamin A'Lee
for the report.
-rwxr-xr-x | bin/spin | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -613,6 +613,7 @@ sub format_string { # can contain multiple paragraphs. sub split_paragraphs { my $text = shift; + $text =~ s/^\n(\s*\n)+/\n/; my @paragraphs; while ($text && $text =~ s/^(.*?(?:\n\n+|\s*\z))//s) { my $paragraph = $1; @@ -1031,6 +1032,7 @@ sub spin { $_ .= $extra; } my $result = parse (escape ($_), 1); + $result =~ s/^(?:\s*\n)+//; output $result unless ($result =~ /^\s*$/); ($fh, $FILE) = @{ $FILES[0] }; } |