user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 09/10] www: use HTML <hr> instead of XHTML <hr />
Date: Wed,  6 Jul 2016 07:14:34 +0000	[thread overview]
Message-ID: <20160706071435.18143-10-e@80x24.org> (raw)
In-Reply-To: <20160706071435.18143-1-e@80x24.org>

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 = "<hr /><pre>$footer</pre>";
+		$footer = "<hr><pre>$footer</pre>";
 	}
 	$fh->write("$footer</body></html>");
 	$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} = '<pre>'.err_txt($ctx, $err).'</pre><hr />';
+		$ctx->{-html_tip} = '<pre>'.err_txt($ctx, $err).'</pre><hr>';
 		$cb = *noop;
 	} elsif ($total == 0) {
 		$code = 404;
-		$ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr />";
+		$ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr>";
 		$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 = "</pre><hr /><pre>Results $beg-$end of $total";
+	my $rv = "</pre><hr><pre>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 ], [
 		"<html><head><title>$title</title></head><body><pre>".
-		join("\n", "<b>$title</b>\n", @body) . '</pre><hr />'.
+		join("\n", "<b>$title</b>\n", @body) . '</pre><hr>'.
 		"<pre>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, '') .
-				'</pre><hr />'
+			$tip . multipart_text_as_html($mime, '') . '</pre><hr>'
 		} 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 = '<hr /><pre>';
+	my $skel = '<hr><pre>';
 	$skel .= $nr == 1 ? 'only message in thread' : 'end of thread';
 	$skel .= ", back to <a\nhref=\"../../\">index</a>";
 	$skel .= "\n<a\nid=t>$nr+ messages in thread:</a> (download: ";
-- 
EW


  parent reply	other threads:[~2016-07-06  7:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06  7:14 [PATCH 0/10] various misc fixes and updates Eric Wong
2016-07-06  7:14 ` [PATCH 01/10] scripts/dc-dlvr: ensure temporary files are removed Eric Wong
2016-07-06  7:14 ` [PATCH 02/10] daemon: disable USR2/TTIN/TTOU/WINCH in workers Eric Wong
2016-07-06  7:14 ` [PATCH 03/10] hval: get rid of unused parameter for new_msgid Eric Wong
2016-07-06  7:14 ` [PATCH 04/10] address: attempt to handle comments somewhat Eric Wong
2016-07-06  7:14 ` [PATCH 05/10] wwwstream: allow undef noop callback Eric Wong
2016-07-06  7:14 ` [PATCH 06/10] extmsg: disable automatic inbox switching Eric Wong
2016-07-06  7:14 ` [PATCH 07/10] extmsg: switch to wwwstream for partial match, too Eric Wong
2016-07-06  7:14 ` [PATCH 08/10] view: fix double-escaping of ghost links Eric Wong
2016-07-06  7:14 ` Eric Wong [this message]
2016-07-06  7:14 ` [PATCH 10/10] feed: fix links to attachments in Atom feed Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160706071435.18143-10-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).