X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=ff36777c60f482286fc92921a4591ba52c184634;hp=e604aee0d84106d83ce487c119d79e662400c268;hb=ddec19694cbf0e1d94fb56c0fc4bd90eae540884;hpb=19671d5736639c9f5d063a87a075fd309e41d203 diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index e604aee0..ff36777c 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -562,7 +562,7 @@ sub add_text_body { # callback for msg_iter $idx[0] = $upfx . $idx[0] if $upfx ne ''; $ctx->{-apfx} = join('/', @idx); $ctx->{-anchors} = {}; # attr => filename - $ctx->{-diff} = $diff = []; + $diff = 1; delete $ctx->{-long_path}; my $spfx; if ($ibx->{-repo_objs}) { @@ -595,14 +595,12 @@ sub add_text_body { # callback for msg_iter attach_link($ctx, $ct, $p, $fn, $err); $$rv .= "\n"; } - my $l = PublicInbox::Linkify->new; + my $l = $ctx->{-linkify} //= PublicInbox::Linkify->new; foreach my $cur (@sections) { if ($cur =~ /\A>/) { flush_quote($rv, $l, \$cur); } elsif ($diff) { - @$diff = split(/^/m, $cur); - $cur = undef; - flush_diff($rv, $ctx, $l); + flush_diff($rv, $ctx, \$cur); } else { # regular lines, OK $$rv .= $l->to_html($cur);