diff options
author | Eric Wong <e@80x24.org> | 2015-09-04 02:18:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-04 02:38:52 +0000 |
commit | 59d0535223c60cfa2697a2af60393d302dde4493 (patch) | |
tree | 2e329b1298b2815c1812a00d03cd4ba363f79d6a /lib | |
parent | eb5b64621f6cb5e8cfb24f651d13453b730c1c1b (diff) | |
download | public-inbox-59d0535223c60cfa2697a2af60393d302dde4493.tar.gz |
They're unused, and they can have namespace conflicts if there's multiple full messages in the thread view.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/View.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 65ef1e78..bd174b1f 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -256,7 +256,7 @@ sub multipart_text_as_html { # scan through all parts, looking for displayable text $mime->walk_parts(sub { my ($part) = @_; - $rv .= add_text_body($enc, $part, \$part_nr, $full_pfx); + $rv .= add_text_body($enc, $part, \$part_nr, $full_pfx, 1); }); $mime->body_set(''); $rv; @@ -308,7 +308,7 @@ sub linkify_2 { } sub flush_quote { - my ($quot, $n, $part_nr, $full_pfx, $final) = @_; + my ($quot, $n, $part_nr, $full_pfx, $final, $do_anchor) = @_; if ($full_pfx) { if (!$final && scalar(@$quot) <= MAX_INLINE_QUOTED) { @@ -342,18 +342,18 @@ sub flush_quote { } else { # show everything in the full version with anchor from # short version (see above) - my $nr = ++$$n; - my $rv = ""; my %l; - $rv .= join('', map { linkify_1(\%l, $_) } @$quot); + my $rv .= join('', map { linkify_1(\%l, $_) } @$quot); @$quot = (); $rv = ascii_html($rv); + return linkify_2(\%l, $rv) unless $do_anchor; + my $nr = ++$$n; "<a\nid=q${part_nr}_$nr></a>" . linkify_2(\%l, $rv); } } sub add_text_body { - my ($enc_msg, $part, $part_nr, $full_pfx) = @_; + my ($enc_msg, $part, $part_nr, $full_pfx, $do_anchor) = @_; return '' if $part->subparts; my $ct = $part->content_type; @@ -383,7 +383,7 @@ sub add_text_body { # show the previously buffered quote inline if (scalar @quot) { $s .= flush_quote(\@quot, \$n, $$part_nr, - $full_pfx, 0); + $full_pfx, 0, $do_anchor); } # regular line, OK @@ -395,7 +395,10 @@ sub add_text_body { push @quot, $cur; } } - $s .= flush_quote(\@quot, \$n, $$part_nr, $full_pfx, 1) if scalar @quot; + if (scalar @quot) { + $s .= flush_quote(\@quot, \$n, $$part_nr, $full_pfx, 1, + $do_anchor); + } $s .= "\n" unless $s =~ /\n\z/s; ++$$part_nr; $s; |