X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=534f85ef9b8110ca86e992d18118be2499786309;hb=31afda256c813443062e0504213d41732e50ee45;hp=2b40bcdd37f31c7e0a715d130a59cd3fd0b4b675;hpb=1365e185d817cdc2de04968c37f597d92226a13b;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2b40bcdd..534f85ef 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -9,6 +9,7 @@ use warnings; use URI::Escape qw/uri_escape_utf8/; use Date::Parse qw/str2time/; use Encode::MIME::Header; +use Plack::Util; use PublicInbox::Hval qw/ascii_html/; use PublicInbox::Linkify; use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/; @@ -26,12 +27,26 @@ sub msg_html { my ($ctx, $mime, $footer) = @_; $footer = defined($footer) ? "\n$footer" : ''; my $hdr = $mime->header_obj; - headers_to_html_header($hdr, $ctx) . - multipart_text_as_html($mime, '') . - '
' .
-		html_footer($hdr, 1, $ctx) .
-		'
' . msg_reply($ctx, $hdr) . - '
'.  $footer . '
'; + my $n = 0; + Plack::Util::inline_object( + close => sub {}, # noop + getline => sub { + my $nr = $n++; + if ($nr == 0) { + headers_to_html_header($hdr, $ctx) . + multipart_text_as_html($mime, '') . + '
' + } elsif ($nr == 1) { + '
' .
+					html_footer($hdr, 1, $ctx) .
+					'
' . msg_reply($ctx, $hdr) . + '
'.  $footer .
+					'
' + } else { + undef + } + } + ) } # /$INBOX/$MESSAGE_ID/#R @@ -44,14 +59,14 @@ sub msg_reply { push @$arg, '/path/to/YOUR_REPLY'; "
". - "You may reply publically to this message via email\n". - "using any one of the following methods:\n\n" . + "You may reply publically to this message via\n". + "plain-text email using any one of the following methods:\n\n" . "* Save the following mbox file, import it into your mail client,\n" . " and reply-to-all from there: mbox\n\n" . "* Reply to all the recipients using the --to, --cc,\n" . " and --in-reply-to switches of git-send-email(1):\n\n" . "\tgit send-email \\\n\t\t" . - join(" \\ \n\t\t", @$arg ). "\n\n" . + join(" \\\n\t\t", @$arg ). "\n\n" . qq( $se_url\n\n) . "* If your mail client supports setting the In-Reply-To" . " header\n via mailto: links, try the " . @@ -324,7 +339,8 @@ sub headers_to_html_header { $v = PublicInbox::Hval->new($v); if ($h eq 'From') { - $title[1] = PublicInbox::Address::from_name($v->raw); + my $n = PublicInbox::Address::from_name($v->raw); + $title[1] = ascii_html($n); } elsif ($h eq 'Subject') { $title[0] = $v->as_html; if ($srch) {