Put more logic into html_footer and less in its only caller so
we can control the buffering and string creation.
# fake an EOF if generating the footer fails;
# we want to at least show the message if something
# here crashes:
# fake an EOF if generating the footer fails;
# we want to at least show the message if something
# here crashes:
- eval {
- my $hdr = delete($ctx->{hdr});
- '<pre>' . html_footer($hdr, 1, $ctx) .
- '</pre>' . msg_reply($ctx, $hdr)
- };
+ eval { html_footer($ctx) };
}
# /$INBOX/$MESSAGE_ID/#R
}
# /$INBOX/$MESSAGE_ID/#R
my ($ctx, $hdr) = @_;
my $se_url =
'https://kernel.org/pub/software/scm/git/docs/git-send-email.html';
my ($ctx, $hdr) = @_;
my $se_url =
'https://kernel.org/pub/software/scm/git/docs/git-send-email.html';
+# returns a string buffer via ->getline
- my ($hdr, $standalone, $ctx, $rhref) = @_;
-
- my $ibx = $ctx->{-inbox} if $ctx;
+ my ($ctx) = @_;
+ my $ibx = $ctx->{-inbox};
+ my $hdr = delete $ctx->{hdr};
- my $tpfx = '';
- my $skel = $standalone ? " <a\nhref=\"$upfx\">index</a>" : '';
- my $irt = '';
- if ($skel && $ibx->over) {
+ my $skel = " <a\nhref=\"$upfx\">index</a>";
+ my $rv = '<pre>';
+ if ($ibx->over) {
- thread_skel(\$skel, $ctx, $hdr, $tpfx);
+ thread_skel(\$skel, $ctx, $hdr, '');
my ($next, $prev);
my $parent = ' ';
$next = $prev = ' ';
my ($next, $prev);
my $parent = ' ';
$next = $prev = ' ';
} elsif ($u) { # unlikely
$parent = " <a\nhref=\"$u\"\nrel=prev>parent</a>";
}
} elsif ($u) { # unlikely
$parent = " <a\nhref=\"$u\"\nrel=prev>parent</a>";
}
- $irt = "$next $prev$parent ";
- } else {
- $irt = '';
+ $rv .= "$next $prev$parent ";
- $rhref ||= '#R';
- $irt .= qq(<a\nhref="$rhref">reply</a>);
- $irt .= $skel;
+ $rv .= qq(<a\nhref="#R">reply</a>);
+ $rv .= $skel;
+ $rv .= '</pre>';
+ $rv .= msg_reply($ctx, $hdr);
}
sub linkify_ref_no_over {
}
sub linkify_ref_no_over {