diff options
author | Eric Wong <e@yhbt.net> | 2020-04-04 08:03:19 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-04 23:37:29 +0000 |
commit | f5aa58801122863961bd9a11e9d9c7b691ffca38 (patch) | |
tree | 5e55dc11a5bd551f2d8e8883a6dff95e500f297e | |
parent | 3cfc29715f29a33d0f433e66c8e98341d4410c41 (diff) | |
download | public-inbox-f5aa58801122863961bd9a11e9d9c7b691ffca38.tar.gz |
No point in having an extra sub for a short, commonly called function in the same file.
-rw-r--r-- | lib/PublicInbox/View.pm | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 12ef6431..1e53d8dc 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -482,17 +482,6 @@ sub multipart_text_as_html { msg_iter($_[0], \&add_text_body, $_[1], 1); } -sub flush_quote { - my ($s, $l, $quot) = @_; - - my $rv = $l->to_html($$quot); - - # we use a <span> here to allow users to specify their own - # color for quoted text - $$quot = undef; - $$s .= qq(<span\nclass="q">) . $rv . '</span>' -} - sub attach_link ($$$$;$) { my ($ctx, $ct, $p, $fn, $err) = @_; my ($part, $depth, @idx) = @$p; @@ -587,14 +576,18 @@ sub add_text_body { # callback for msg_iter my $l = $ctx->{-linkify} //= PublicInbox::Linkify->new; foreach my $cur (@sections) { if ($cur =~ /\A>/) { - flush_quote($rv, $l, \$cur); + # we use a <span> here to allow users to specify + # their own color for quoted text + $$rv .= qq(<span\nclass="q">); + $$rv .= $l->to_html($cur); + $$rv .= '</span>'; } elsif ($diff) { flush_diff($ctx, \$cur); } else { # regular lines, OK $$rv .= $l->to_html($cur); - $cur = undef; } + $cur = undef; } obfuscate_addrs($ibx, $$rv) if $ibx->{obfuscate}; |