X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FFeed.pm;h=36802fa1fc79def41fd380907e274185bc587226;hb=5422a844b7384c32b3532d128e15e0b50d24435b;hp=7ebc0505602f5e11d6ce5b39fc8d8b4ebf461805;hpb=398e29344ecc43548a7d3998bb5d2fcee62d66cd;p=public-inbox.git diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 7ebc0505..36802fa1 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -5,22 +5,19 @@ package PublicInbox::Feed; use strict; use warnings; -use Email::Address; use Email::MIME; use Date::Parse qw(strptime); -use PublicInbox::Hval; +use PublicInbox::Hval qw/ascii_html/; use PublicInbox::Git; use PublicInbox::View; use PublicInbox::MID qw/mid_clean mid2path/; +use PublicInbox::Address; use POSIX qw/strftime/; use constant { DATEFMT => '%Y-%m-%dT%H:%M:%SZ', # Atom standard MAX_PER_PAGE => 25, # this needs to be tunable }; -use Encode qw/find_encoding/; -my $enc_utf8 = find_encoding('UTF-8'); - # main function sub generate { my ($ctx) = @_; @@ -41,8 +38,9 @@ sub generate_html_index { sub title_tag { my ($title) = @_; + $title =~ tr/\t\n / /s; # squeeze spaces # try to avoid the type attribute in title: - $title = PublicInbox::Hval->new_oneline($title)->as_html; + $title = ascii_html($title); my $type = index($title, '&') >= 0 ? "\ntype=\"html\"" : ''; "