X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=12ef643110348e779da226801ed420868993e351;hb=3cfc29715f29a33d0f433e66c8e98341d4410c41;hp=c42654b68204c67f697278bedfba504850b8c889;hpb=fc92ce8845ac5f09939722537624fa48441f7c0b;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index c42654b6..12ef6431 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -504,9 +504,6 @@ sub attach_link ($$$$;$) { # spotting MUA problems: $ct =~ s/;.*// unless $err; $ct = ascii_html($ct); - my $desc = $part->header('Content-Description'); - $desc = $fn unless defined $desc; - $desc = '' unless defined $desc; my $sfn; if (defined $fn && $fn =~ /\A$PublicInbox::Hval::FN\z/o) { $sfn = $fn; @@ -518,10 +515,13 @@ sub attach_link ($$$$;$) { my $rv = $ctx->{obuf}; $$rv .= qq($nl{mhref}$idx-$sfn">); if ($err) { - $$rv .= "[-- Warning: decoded text below may be mangled --]\n"; + $$rv .= <header('Content-Description') // $fn // ''; $desc = ascii_html($desc); $$rv .= ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]"; $$rv .= "\n"; @@ -576,7 +576,7 @@ sub add_text_body { # callback for msg_iter $s .= "\n" unless $s =~ /\n\z/s; # split off quoted and unquoted blocks: - my @sections = split(/((?:^>[^\n]*\n)+)/sm, $s); + my @sections = PublicInbox::MsgIter::split_quotes($s); $s = ''; my $rv = $ctx->{obuf}; if (defined($fn) || $depth > 0 || $err) { @@ -589,7 +589,7 @@ sub add_text_body { # callback for msg_iter if ($cur =~ /\A>/) { flush_quote($rv, $l, \$cur); } elsif ($diff) { - flush_diff($rv, $ctx, \$cur); + flush_diff($ctx, \$cur); } else { # regular lines, OK $$rv .= $l->to_html($cur); @@ -888,20 +888,20 @@ sub missing_thread { sub dedupe_subject { my ($prev_subj, $subj, $val) = @_; - my $omit = ''; # '"' denotes identical text omitted + my $omit; # '"' denotes identical text omitted my (@prev_pop, @curr_pop); while (@$prev_subj && @$subj && $subj->[-1] eq $prev_subj->[-1]) { push(@prev_pop, pop(@$prev_subj)); push(@curr_pop, pop(@$subj)); - $omit ||= $val; + $omit //= $val; } pop @$subj if @$subj && $subj->[-1] =~ /^re:\s*/i; if (scalar(@curr_pop) == 1) { - $omit = ''; + $omit = undef; push @$prev_subj, @prev_pop; push @$subj, @curr_pop; } - $omit; + $omit // ''; } sub skel_dump { # walk_thread callback