lib/PublicInbox/Feed.pm | 2 +- lib/PublicInbox/View.pm | 6 +++--- lib/PublicInbox/WWW.pm | 4 ++-- t/view.t | 8 ++++---- diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 09eb2fcaca7bdcec7bf8ae6624f9fa0d6a23df24..12ac8a95be278bb046962e1233b4442707a59df9 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -243,7 +243,7 @@ my $mid = $mime->header_obj->header_raw('Message-ID'); defined $mid or return 0; $mid = PublicInbox::Hval->new_msgid($mid); my $href = $mid->as_href . '.html'; - my $content = PublicInbox::View->as_feed_entry($mime, $fullurl . $href); + my $content = PublicInbox::View->feed_entry($mime, $fullurl . $href); defined($content) or return 0; my $subject = mime_header($mime, 'Subject') or return 0; diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index a43ab620792c8de7aeb2f155d3923cc5ff36f14f..52e8f0b290b59692f50693af0999c525493af6c9 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -16,7 +16,7 @@ my $enc_utf8 = find_encoding('UTF-8'); my $enc_mime = find_encoding('MIME-Header'); # public functions: -sub as_html { +sub msg_html { my ($class, $mime, $full_pfx) = @_; headers_to_html_header($mime, $full_pfx) . @@ -26,10 +26,10 @@ html_footer($mime) . ''; } -sub as_feed_entry { +sub feed_entry { my ($class, $mime, $full_pfx) = @_; - "
" . multipart_text_as_html($mime, $full_pfx) . "
"; + '
' . multipart_text_as_html($mime, $full_pfx) . '
'; } diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 4dbfe47dc97e15e0b532da6e83ad09d6696b9aec..898f42a8c56379ab48bfde3ad34ca11f97a32bd8 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -166,7 +166,7 @@ uri_escape_utf8($ctx->{mid})); my $pfx = "../f/$mid_href.html"; require Email::MIME; [ 200, [ 'Content-Type' => 'text/html; charset=UTF-8' ], - [ PublicInbox::View->as_html(Email::MIME->new($x), $pfx) ] ]; + [ PublicInbox::View->msg_html(Email::MIME->new($x), $pfx) ] ]; } # /$LISTNAME/f/$MESSAGE_ID.html -> HTML content (fullquotes) @@ -177,7 +177,7 @@ return r404() unless $x; require PublicInbox::View; require Email::MIME; [ 200, [ 'Content-Type' => 'text/html' ], - [ PublicInbox::View->as_html(Email::MIME->new($x))] ]; + [ PublicInbox::View->msg_html(Email::MIME->new($x))] ]; } sub self_url { diff --git a/t/view.t b/t/view.t index 87f8eeeeea88380bd3b2239af232af83927c9503..10a182b355da5786a5995c87c40f7208643404f4 100644 --- a/t/view.t +++ b/t/view.t @@ -34,7 +34,7 @@ ], body => $body, ); $s = Email::MIME->new($s->as_string); - my $html = PublicInbox::View->as_html($s); + my $html = PublicInbox::View->msg_html($s); # ghetto tests like($html, qr!as_html($s, $pfx); + my $short = PublicInbox::View->msg_html($s, $pfx); like($short, qr! $parts, ); - my $html = PublicInbox::View->as_html($mime); + my $html = PublicInbox::View->msg_html($mime); like($html, qr/hi\n-+ part #2 -+\nbye\n/, "multipart split"); } @@ -105,7 +105,7 @@ ], parts => $parts, ); - my $html = PublicInbox::View->as_html($mime); + my $html = PublicInbox::View->msg_html($mime); like($html, qr!see attached patch\n-+ foo\.patch -+\n--- a/file\n!, "parts split with filename"); }