-# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
+# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
package PublicInbox::View;
use strict;
my $ct = $part->content_type;
# account for filter bugs...
- if (defined $ct && $ct =~ m!\btext/[xh]+tml\b!i) {
+ if (defined $ct && $ct =~ m!\btext/x?html\b!i) {
$part->body_set('');
return '';
}
my $header_obj = $mime->header_obj;
my $mid = $header_obj->header('Message-ID');
$mid = PublicInbox::Hval->new_msgid($mid);
- my $mid_href = $mid->as_href;
foreach my $h (qw(From To Cc Subject Date)) {
my $v = $mime->header($h);
defined($v) && ($v ne '') or next;
}
$rv .= 'Message-ID: <' . $mid->as_html . '> ';
- my $raw_ref = $full_pfx ? 'raw' : '../raw';
- $rv .= "(<a\nhref=\"$raw_ref\">raw</a>)\n";
+ my $upfx = $full_pfx ? '' : '../';
+ $rv .= "(<a\nhref=\"${upfx}raw\">raw</a>)\n";
if ($srch) {
- $rv .= "<a\nhref=\"#r\">References: [see below]</a>\n";
+ $rv .= "<a\nhref=\"${upfx}t/\">References: [expand]</a>\n";
} else {
$rv .= _parent_headers_nosrch($header_obj);
}
foreach my $g (@$ghost) {
$$cb->write("<table\nsummary=ghost><tr><td>" .
(INDENT x $g->[1]) . "</td><td>" .
- PRE_WRAP . ghost_parent('', $g->[0]) .
+ PRE_WRAP . ghost_parent('../', $g->[0]) .
'</pre></td></table>');
}
}