diff options
-rw-r--r-- | lib/PublicInbox/View.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 575c5ffd..47082431 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -201,14 +201,17 @@ sub index_walk { # Drop signatures $s =~ s/^-- \n.*\z//ms and $$more = 'more...'; - # kill any leading or trailing whitespace - $s =~ s/\A\s+//s; + # kill any leading or trailing whitespace lines + $s =~ s/^\s*$//sgm; $s =~ s/\s+\z//s; if (length $s) { # add prefix: $s =~ s/^/$pfx/sgm; + # kill per-line trailing whitespace + $s =~ s/[ \t]+$//sgm; + $rv .= $s . "\n"; } $rv; |