From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] feed: inline feed entry generation
Date: Wed, 18 May 2016 02:34:01 +0000 [thread overview]
Message-ID: <20160518023401.15988-1-e@80x24.org> (raw)
Remove unnecessary wrapper subroutines and constants
which are only used once.
---
lib/PublicInbox/Feed.pm | 6 +++---
lib/PublicInbox/Hval.pm | 1 -
lib/PublicInbox/View.pm | 7 -------
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 52fe0db..0b864c2 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -316,10 +316,10 @@ sub add_to_feed {
defined $mid or return 0;
$mid = PublicInbox::Hval->new_msgid($mid);
my $href = $mid->as_href;
- my $content = PublicInbox::View->feed_entry($mime);
- defined($content) or return 0;
- $mime = undef;
+ my $content = qq(<pre\nstyle="white-space:pre-wrap">) .
+ PublicInbox::View::multipart_text_as_html($mime) .
+ '</pre>';
my $date = $header_obj->header('Date');
my $updated = feed_updated($date);
diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm
index 70bae7c..9ba7809 100644
--- a/lib/PublicInbox/Hval.pm
+++ b/lib/PublicInbox/Hval.pm
@@ -16,7 +16,6 @@ our @EXPORT_OK = qw/ascii_html/;
# and screw up rendering on some browsers. This is the only CSS style
# feature we use.
use constant STYLE => '<style>pre{white-space:pre-wrap}</style>';
-use constant PRE => "<pre\nstyle=\"white-space:pre-wrap\">"; # legacy
my $enc_ascii = find_encoding('us-ascii');
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 3fa7cfc..2513cd0 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -73,13 +73,6 @@ sub msg_reply {
'</pre><hr /><pre>' . $footer . '</pre></body></html>';
}
-sub feed_entry {
- my ($class, $mime) = @_;
-
- # no <head> here for <style>...
- PublicInbox::Hval::PRE . multipart_text_as_html($mime) . '</pre>';
-}
-
sub in_reply_to {
my ($hdr) = @_;
my $irt = $hdr->header_raw('In-Reply-To');
reply other threads:[~2016-05-18 2:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160518023401.15988-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).