From 98c3b0f53ffbdbf61cc25f6c3678090eaa54a799 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 6 May 2014 19:44:43 +0000 Subject: consistently whitespace wrap on
 sections

Horizontal scrolling is a usability problem for GUI browsers,
so help them avoid it.  I love GUI users, really! :)
---
 lib/PublicInbox/Feed.pm | 5 +++--
 lib/PublicInbox/View.pm | 7 ++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index e9989e41..0104a6ba 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -11,6 +11,7 @@ use PublicInbox::GitCatFile;
 use constant {
 	DATEFMT => '%Y-%m-%dT%H:%M:%SZ', # atom standard
 	MAX_PER_PAGE => 25, # this needs to be tunable
+	PRE_WRAP => '
',
 };
 
 # main function
@@ -75,7 +76,7 @@ sub generate_html_index {
 	my $html = "$title" .
 		'' .
-		'
';
+		'' . PRE_WRAP;
 
 	# sort by date, most recent at top
 	$th->order(sub {
@@ -91,7 +92,7 @@ sub generate_html_index {
 	my $footer = nav_footer($args->{cgi}, $last, $feed_opts);
 	my $list_footer = $args->{footer};
 	$footer .= "\n" . $list_footer if ($footer && $list_footer);
-	$footer = "
$footer
" if $footer; + $footer = "
" . PRE_WRAP . "$footer
" if $footer; $html . "
$footer"; } diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 86066311..8bc28cd1 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -12,6 +12,7 @@ use Email::MIME::ContentType qw/parse_content_type/; # TODO: make these constants tunable use constant MAX_INLINE_QUOTED => 5; use constant MAX_TRUNC_LEN => 72; +use constant PRE_WRAP => '
';
 
 *ascii_html = *PublicInbox::Hval::ascii_html;
 
@@ -28,7 +29,7 @@ sub msg_html {
 	}
 	headers_to_html_header($mime, $full_pfx) .
 		multipart_text_as_html($mime, $full_pfx) .
-		'

' .
+		'

' . PRE_WRAP . html_footer($mime) . $footer . '
'; } @@ -36,7 +37,7 @@ sub msg_html { sub feed_entry { my ($class, $mime, $full_pfx) = @_; - '
' . multipart_text_as_html($mime, $full_pfx) . '
'; + PRE_WRAP . multipart_text_as_html($mime, $full_pfx) . ''; } @@ -199,7 +200,7 @@ sub headers_to_html_header { $rv .= "\n"; ("". join(' - ', @title) . - '
' .  $rv);
+	 '' . PRE_WRAP . $rv);
 }
 
 sub html_footer {
-- 
cgit v1.2.3-24-ge0c7