From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 37C0E20715 for ; Wed, 6 Jul 2016 07:14:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 09/10] www: use HTML
instead of XHTML
Date: Wed, 6 Jul 2016 07:14:34 +0000 Message-Id: <20160706071435.18143-10-e@80x24.org> In-Reply-To: <20160706071435.18143-1-e@80x24.org> References: <20160706071435.18143-1-e@80x24.org> List-Id: We only need XHTML-compatibility inside Atom feeds, as anecdotally, feed readers are stricter than normal browsers and some do not support HTML, only XHTML. So we will continue to accomodate them. However we favor HTML elsewhere since it tends to be smaller than the equivalent well-formed XHTML. --- lib/PublicInbox/Feed.pm | 2 +- lib/PublicInbox/SearchView.pm | 6 +++--- lib/PublicInbox/Unsubscribe.pm | 2 +- lib/PublicInbox/View.pm | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 2983514..1f88aba 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -188,7 +188,7 @@ sub emit_html_index { if ($footer) { my $list_footer = $ctx->{footer}; $footer .= "\n\n" . $list_footer if $list_footer; - $footer = "
$footer
"; + $footer = "
$footer
"; } $fh->write("$footer"); $fh->close; diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 15bb823..80a2ff7 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -38,11 +38,11 @@ sub sres_top_html { my $cb; if ($err) { $code = 400; - $ctx->{-html_tip} = '
'.err_txt($ctx, $err).'

'; + $ctx->{-html_tip} = '
'.err_txt($ctx, $err).'

'; $cb = *noop; } elsif ($total == 0) { $code = 404; - $ctx->{-html_tip} = "
\n[No results found]

"; + $ctx->{-html_tip} = "
\n[No results found]

"; $cb = *noop; } else { my $x = $q->{x}; @@ -126,7 +126,7 @@ sub search_nav_bot { my $o = $q->{o}; my $end = $o + $nr; my $beg = $o + 1; - my $rv = "
Results $beg-$end of $total";
+	my $rv = "

Results $beg-$end of $total";
 	my $n = $o + $LIM;
 
 	if ($n < $total) {
diff --git a/lib/PublicInbox/Unsubscribe.pm b/lib/PublicInbox/Unsubscribe.pm
index 46d5d8d..fca300e 100644
--- a/lib/PublicInbox/Unsubscribe.pm
+++ b/lib/PublicInbox/Unsubscribe.pm
@@ -136,7 +136,7 @@ sub r {
 	my ($self, $code, $title, @body) = @_;
 	[ $code, [ @CT_HTML ], [
 		"$title
".
-		join("\n", "$title\n", @body) . '

'. + join("\n", "$title\n", @body) . '

'. "
This page is available under AGPL-3.0+\n" .
 		"git clone $self->{code_url}\n" .
 		qq(Email $self->{contact} if you have any questions).
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c230836..7ff3b40 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -30,8 +30,7 @@ sub msg_html {
 	PublicInbox::WwwStream->response($ctx, 200, sub {
 		my ($nr, undef) = @_;
 		if ($nr == 1) {
-			$tip . multipart_text_as_html($mime, '') .
-				'

' + $tip . multipart_text_as_html($mime, '') . '
' } elsif ($nr == 2) { # fake an EOF if generating the footer fails; # we want to at least show the message if something @@ -321,7 +320,7 @@ sub thread_html { my $msgs = load_results($sres); my $nr = $sres->{total}; return missing_thread($ctx) if $nr == 0; - my $skel = '
';
+	my $skel = '
';
 	$skel .= $nr == 1 ? 'only message in thread' : 'end of thread';
 	$skel .= ", back to index";
 	$skel .= "\n$nr+ messages in thread: (download: ";
-- 
EW