We don't want to blindly append a trailing newline
if the message ends in quoted text leading to a <span>,
as a newline is already added to a <span>...
- $s .= "\n"; # ensure there's a trailing newline
-
# scan through all parts, looking for displayable text
msg_iter($mime, sub {
my ($p) = @_;
# scan through all parts, looking for displayable text
msg_iter($mime, sub {
my ($p) = @_;
- $p = add_text_body($upfx, $p);
- $rv .= $p;
- $rv .= "\n" if $p ne '';
+ $rv .= add_text_body($upfx, $p);
my $rv = $l->linkify_1(join('', @$quot));
@$quot = ();
my $rv = $l->linkify_1(join('', @$quot));
@$quot = ();
- # we use a <div> here to allow users to specify their own
+ # we use a <span> here to allow users to specify their own
# color for quoted text
$rv = $l->linkify_2(ascii_html($rv));
$$s .= qq(<span\nclass="q">) . $rv . '</span>'
# color for quoted text
$rv = $l->linkify_2(ascii_html($rv));
$$s .= qq(<span\nclass="q">) . $rv . '</span>'
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 --]");
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>');
+ join('', @ret, "</a>\n");
$s = '';
if (defined($fn) || $depth > 0) {
$s .= attach_link($upfx, $ct, $p, $fn);
$s = '';
if (defined($fn) || $depth > 0) {
$s .= attach_link($upfx, $ct, $p, $fn);
}
my @quot;
my $l = PublicInbox::Linkify->new;
}
my @quot;
my $l = PublicInbox::Linkify->new;
- flush_quote(\$s, $l, \@quot) if @quot;
+ my $end = "\n";
+ if (@quot) {
+ $end = '';
+ flush_quote(\$s, $l, \@quot);
+ }
$s =~ s/[ \t]+$//sgm; # kill per-line trailing whitespace
$s =~ s/\A\n+//s; # kill leading blank lines
$s =~ s/[ \t]+$//sgm; # kill per-line trailing whitespace
$s =~ s/\A\n+//s; # kill leading blank lines
- $s =~ s/\s+\z//s; # kill all trailing spaces (final "\n" added if ne '')
- $s;
+ $s =~ s/\s+\z//s; # kill all trailing spaces
+ $s .= $end;
}
sub _msg_html_prepare {
}
sub _msg_html_prepare {