X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=f7a8ae3289337279c68c1e48e452eb9049be857f;hp=5144a13046081eaefe53a39686341427a38faeb4;hb=c2bc9ebcb770a27823d8e989707f434826333b0e;hpb=65b37aeb8392a62e9aa8ceac08227c77c6fa6b8b diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 5144a130..f7a8ae32 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -536,11 +536,14 @@ sub add_text_body { # callback for msg_iter # always support diff-highlighting, but we can't linkify hunk # headers for solver unless some coderepo are configured: my $diff; - if ($s =~ /^(?:diff|---|\+{3}) /ms) { + if ($s =~ /^--- [^\n]+\n\+{3} [^\n]+\n@@ /ms) { # diffstat anchors do not link across attachments or messages: $idx[0] = $upfx . $idx[0] if $upfx ne ''; $ctx->{-apfx} = join('/', @idx); - $ctx->{-anchors} = {}; # attr => filename + + # do attr => filename mappings for diffstats in git diffs: + $ctx->{-anchors} = {} if $s =~ /^diff --git /sm; + $diff = 1; delete $ctx->{-long_path}; my $spfx;