about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 2303a1fa..ec5f3907 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -260,7 +260,6 @@ sub attach_link ($$$$) {
         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 @@ sub attach_link ($$$$) {
         } else {
                 $sfn = 'a.bin';
         }
-        qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx$desc --]\n) .
-        "[-- Type: $ct, Size: $size bytes --]</a>"
+        my @ret = qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx: );
+        my $ts = "Type: $ct, Size: $size bytes";
+        push(@ret, ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]");
+        join('', @ret, '</a>');
 }
 
 sub add_text_body {