$ctx->{-linkify}->linkify_mids('..', \$s, 1);
$rv .= $s;
}
- _parent_headers($ctx, $eml);
- $rv .= "\n";
+ $rv .= _parent_headers($ctx, $eml);
1;
}
my ($ctx, $hdr) = @_;
my @irt = $hdr->header_raw('In-Reply-To');
my $refs;
- if (@irt) {
- my $s = '';
- $s .= "In-Reply-To: $_\n" for @irt;
- $ctx->{-linkify}->linkify_mids('..', \$s);
- ${$ctx->{obuf}} .= $s;
- } else {
+ my $s = '';
+ if (!@irt) {
$refs = references($hdr);
- my $irt = pop @$refs;
- if (defined $irt) {
- my $html = ascii_html($irt);
- my $href = mid_href($irt);
- ${$ctx->{obuf}} .= <<EOM;
-In-Reply-To: <<a\nhref="../$href/">$html</a>>
-EOM
- }
+ $irt[0] = pop(@$refs) if scalar @$refs;
}
+ $s .= "In-Reply-To: $_\n" for @irt;
# do not display References: if search is present,
# we show the thread skeleton at the bottom, instead.
- return if $ctx->{ibx}->over;
-
- $refs //= references($hdr);
- if (@$refs) {
- $_ = linkify_ref_no_over($_) for @$refs;
- ${$ctx->{obuf}} .= 'References: '. join("\n\t", @$refs) . "\n";
+ if (!$ctx->{ibx}->over) {
+ $refs //= references($hdr);
+ $s .= 'References: <'.join(">\n\t<", @$refs).">\n" if @$refs;
}
+ $ctx->{-linkify}->linkify_mids('..', \$s); # escapes HTML
+ $s .= "\n";
}
# appends to obuf
$ctx->zmore($skel .= msg_reply($ctx, $hdr)); # flushes obuf
}
-sub linkify_ref_no_over {
- my ($mid) = @_;
- my $href = mid_href($mid);
- my $html = ascii_html($mid);
- "<<a\nhref=\"../$href/\">$html</a>>";
-}
-
sub ghost_parent {
my ($upfx, $mid) = @_;