my $nl = $idx eq '1' ? '' : "\n"; # like join("\n", ...)
my $size = length($part->body);
+ delete $part->{bdy}; # save memory
# hide attributes normally, unless we want to aid users in
# spotting MUA problems:
# makes no difference to browsers, and don't screw up filename
# link generation in diffs with the extra '%0D'
- $s =~ s/\r\n/\n/sg;
+ $s =~ s/\r+\n/\n/sg;
# will be escaped to `•' in HTML
obfuscate_addrs($ibx, $s, "\x{2022}") if $ibx->{obfuscate};
$ctx->{-spfx} = $spfx;
};
- # some editors don't put trailing newlines at the end:
- $s .= "\n" unless $s =~ /\n\z/s;
-
# split off quoted and unquoted blocks:
my @sections = PublicInbox::MsgIter::split_quotes($s);
undef $s; # free memory
attach_link($ctx, $ct, $p, $fn, $err);
$$rv .= "\n";
}
+ delete $part->{bdy}; # save memory
foreach my $cur (@sections) {
if ($cur =~ /\A>/) {
# we use a <span> here to allow users to specify
$$skel .= delete($ctx->{sl_note}) || '';
}
- my $f = ascii_html($smsg->{from_name});
+ my $f = ascii_html(delete $smsg->{from_name});
my $obfs_ibx = $ctx->{-obfs_ibx};
obfuscate_addrs($obfs_ibx, $f) if $obfs_ibx;
}
sub sort_ds {
- [ sort {
+ @{$_[0]} = sort {
(eval { $a->topmost->{ds} } || 0) <=>
(eval { $b->topmost->{ds} } || 0)
- } @{$_[0]} ];
+ } @{$_[0]};
}
# accumulate recent topics if search is supported