]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
Merge remote-tracking branch 'origin/search'
[public-inbox.git] / lib / PublicInbox / View.pm
index 575c5ffd31c098b4c5eb07a4322e47c27772cde1..47082431ec8fa375580c7b85afa95117ea0496a9 100644 (file)
@@ -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;