From: Eric Wong Date: Thu, 28 Aug 2014 05:06:41 +0000 (+0000) Subject: view: tighten up regexps used for trimming index X-Git-Tag: v1.0.0~1129 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1f23784800e0cc018b0e8565ca06bab0b2d08f7c;p=public-inbox.git view: tighten up regexps used for trimming index The previous regexp matches were too aggressive w.r.t. scissors. We destroy trailing whitespace anyways, so do not worry about it when cutting signatures and patches off. --- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 23cb369b..d1bb9356 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -95,11 +95,11 @@ sub index_entry { $s =~ s/(?:^[^\n]*:\s*\n)?(?:^>[^\n]*\n)+(?:^\s*\n)?//mg; # Drop signatures - $s =~ s/\n*-- \n.*\z//s; + $s =~ s/^-- \n.*\z//ms; # drop the remainder of git patches, they're usually better # to review when the full message is viewed - if ($s =~ s/\n*---\n.*\z//s) { + if ($s =~ s/^---\n.*\z//ms) { $more = "$pfx...\n"; }