diff options
author | Eric Wong <e@80x24.org> | 2015-12-25 11:48:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-12-25 12:05:50 +0000 |
commit | 398e29344ecc43548a7d3998bb5d2fcee62d66cd (patch) | |
tree | fbeac65ecb0d542ed8341d442e85b0933a4ecf4a /lib/PublicInbox/Hval.pm | |
parent | a5409589fe53734ed073dddb15f0a8033052986b (diff) | |
download | public-inbox-398e29344ecc43548a7d3998bb5d2fcee62d66cd.tar.gz |
view: favor whitespace wrap in <head>
If we bite the bullet and rely on inline CSS, we might as well only specify it once per page instead of inline in every <pre> tag which may handle UGC. So this actually saves us a small amount of bandwith on most pages which have multiple <pre> start tags.
Diffstat (limited to 'lib/PublicInbox/Hval.pm')
-rw-r--r-- | lib/PublicInbox/Hval.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index e0b85c68..5a869358 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -13,7 +13,8 @@ use PublicInbox::MID qw/mid_clean/; # for user-generated content (UGC) which may have excessively long lines # and screw up rendering on some browsers. This is the only CSS style # feature we use. -use constant PRE => "<pre\nstyle=\"white-space:pre-wrap\">"; +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'); |