From e00a6f63ef80f3540a159ef4fdc4bba359dc5596 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Dec 2015 20:58:50 +0000 Subject: hval: move PRE constant for wrapping UGC here User-generated content (UGC) may have excessively long lines which screw up rendering. This is the only bit of CSS we use. --- lib/PublicInbox/View.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 3c4e9547..68741c5e 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -21,7 +21,6 @@ require POSIX; # TODO: make these constants tunable use constant MAX_INLINE_QUOTED => 12; # half an 80x24 terminal use constant MAX_TRUNC_LEN => 72; -use constant PRE_WRAP => ""; use constant T_ANCHOR => '#u'; use constant INDENT => ' '; @@ -39,7 +38,7 @@ sub msg_html { } headers_to_html_header($mime, $full_pfx, $ctx) . multipart_text_as_html($mime, $full_pfx) . - '
' . PRE_WRAP . + '
' . PublicInbox::Hval::PRE . html_footer($mime, 1, $full_pfx, $ctx) . $footer . ''; @@ -48,7 +47,8 @@ sub msg_html { sub feed_entry { my ($class, $mime, $full_pfx) = @_; - PRE_WRAP . multipart_text_as_html($mime, $full_pfx) . ''; + PublicInbox::Hval::PRE . + multipart_text_as_html($mime, $full_pfx) . ''; } sub in_reply_to { @@ -107,7 +107,7 @@ sub index_entry { if ($level) { $rv .= '
' . (INDENT x $level) . '
'; } - $rv .= "" . PRE_WRAP; + $rv .= "" . PublicInbox::Hval::PRE; $rv .= "$subj\n"; $rv .= "- $from @ $ts UTC - "; $rv .= "next"; @@ -206,8 +206,8 @@ sub emit_thread_html { $next .= "\ndownload thread: "; $next .= "mbox.gz"; $next .= " / follow: Atom feed"; - $cb->write("
" . PRE_WRAP . $next . "\n\n". $foot . - ""); + $cb->write("
" . PublicInbox::Hval::PRE . $next . "\n\n". + $foot . ""); $cb->close; } @@ -457,7 +457,7 @@ sub headers_to_html_header { $rv .= "\n"; ("". join(' - ', @title) . - "$atom" . PRE_WRAP . $rv); + "$atom" . PublicInbox::Hval::PRE . $rv); } sub thread_inline { @@ -634,7 +634,7 @@ sub ghost_table { my ($upfx, $mid, $level) = @_; "" . (INDENT x $level) . "" . - PRE_WRAP . ghost_parent($upfx, $mid) . + PublicInbox::Hval::PRE . ghost_parent($upfx, $mid) . ''; } -- cgit v1.2.3-24-ge0c7