lib/PublicInbox/View.pm | 7 +++++-- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 660a112ff3c67633bad4cedf366321e89f951e54..e1632b5bec319fa6667925e79f9d31d50d30df0e 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -142,13 +142,16 @@ # 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/^[ \t]$//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"; }