]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
view: use inline style directly for feed display
authorEric Wong <e@80x24.org>
Tue, 5 Jan 2016 00:16:41 +0000 (00:16 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Apr 2016 18:58:27 +0000 (18:58 +0000)
And remove the legacy constant from PublicInbox::Hval.
Relying on the short <style> section should simplify our code.

lib/PublicInbox/Hval.pm
lib/PublicInbox/View.pm

index c38ef7d8edef7567b6ac768a360605c195e245f0..d908bec2f3dbb61c714c40a835fb41936bb55ca1 100644 (file)
@@ -16,7 +16,6 @@ our @EXPORT_OK = qw/ascii_html utf8_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_utf8 = find_encoding('UTF-8');
 my $enc_ascii = find_encoding('us-ascii');
index f074a24487e7612c64a81f224d1715eef1c8a6b2..a4047aa2f67aa2839164f511df136b755c285f98 100644 (file)
@@ -79,7 +79,7 @@ sub feed_entry {
        my ($class, $mime, $full_pfx) = @_;
 
        # no <head> here for <style>...
-       PublicInbox::Hval::PRE .
+       qq(<pre\nstyle="white-space:pre-wrap">) .
                multipart_text_as_html($mime, $full_pfx) . '</pre>';
 }