$ctx->{mhref} = ($ctx->{nr} || $ctx->{smsg}) ?
"../${\mid_href($smsg->{mid})}/" : '';
if (_msg_page_prepare_obuf($eml, $ctx)) {
- multipart_text_as_html($eml, $ctx);
- ${$ctx->{obuf}} .= '</pre><hr>';
+ $eml->each_part(\&add_text_body, $ctx, 1);
+ $ctx->zmore('</pre><hr>');
}
html_footer($ctx, $ctx->{first_hdr}) if !$ctx->{smsg};
delete($ctx->{obuf}) // \'';
$ctx->{mhref} = '';
PublicInbox::WwwStream::init($ctx);
if (_msg_page_prepare_obuf($eml, $ctx)) { # sets {-title_html}
- multipart_text_as_html($eml, $ctx);
- ${$ctx->{obuf}} .= '</pre><hr>';
+ $eml->each_part(\&add_text_body, $ctx, 1);
+ $ctx->zmore('</pre><hr>');
}
html_footer($ctx, $eml);
$ctx->html_done;
}
}
-sub multipart_text_as_html {
- # ($mime, $ctx) = @_; # each_part may do "$_[0] = undef"
-
- # scan through all parts, looking for displayable text
- $_[0]->each_part(\&add_text_body, $_[1], 1);
-}
-
sub submsg_hdr ($$) {
my ($ctx, $eml) = @_;
my $obfs_ibx = $ctx->{-obfs_ibx};
$ctx->{obuf} = \$s;
$ctx->{mhref} = $href;
$ctx->{changed_href} = "${href}#related";
- PublicInbox::View::multipart_text_as_html($eml, $ctx);
- delete $ctx->{obuf};
- $s .= '</pre></div></content></entry>';
+ $eml->each_part(\&PublicInbox::View::add_text_body, $ctx, 1);
+ '</pre></div></content></entry>';
}
sub feed_updated {