lib/PublicInbox/View.pm | 7 ++++--- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2303a1fa9e0a10e414d5132a3ee8280e50798532..ec5f39076eccc64d15d87699ca8919e2b4d3200f 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -260,7 +260,6 @@ $ct = ascii_html($ct); my $desc = $part->header('Content-Description'); $desc = $fn unless defined $desc; $desc = '' unless defined $desc; - $desc = ': '.$desc if $desc; my $sfn; if (defined $fn && $fn =~ /\A[\w\.-]+[a-zA-Z0-9]\z/) { $sfn = $fn; @@ -269,8 +268,10 @@ $sfn = 'a.txt'; } else { $sfn = 'a.bin'; } - qq($nl[-- Attachment #$idx$desc --]\n) . - "[-- Type: $ct, Size: $size bytes --]" + my @ret = qq($nl[-- Attachment #$idx: ); + my $ts = "Type: $ct, Size: $size bytes"; + push(@ret, ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]"); + join('', @ret, ''); } sub add_text_body {