From 1f23784800e0cc018b0e8565ca06bab0b2d08f7c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 Aug 2014 05:06:41 +0000 Subject: 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. --- lib/PublicInbox/View.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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"; } -- cgit v1.2.3-24-ge0c7