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: Re: [RFC] www: set "<!DOCTYPE html>" everywhere
Date: Sun, 28 Apr 2019 22:32:26 +0000	[thread overview]
Message-ID: <20190428223226.GA22804@dcvr> (raw)
In-Reply-To: <20190427212334.uhc2z4ju6tivnrbl@whir>

Eric Wong <e@80x24.org> wrote:
> t/check-www-inbox.perl now runs tidy(1) for every text/html
> response, now.

tidy is definitely useful and exposed a bug with unescaped URLs
in ExtMsg:

https://public-inbox.org/git/20190428221229.22691-1-e@80x24.org/

> I'm no fan of the "Living Standard" quicksand that is HTML 5
> (or wasting 15 bytes on every response).  However, being easy
> to validate everything with tidy(1) seems alright...

However the 15 wasted bytes at the beginning of every single
response still bothers me.  AFAIK every HTML renderer works
fine without it.

Also, our Atom feeds use XHTML (instead of HTML), since Atom
feed parsers need to understand XML, anyways, and may get
the non-overlapping parts of HTML wrong.


So, an alternate change could be merely prepending "<!doctype html>"
before we spawn tidy:

> --- a/t/check-www-inbox.perl
> +++ b/t/check-www-inbox.perl
> @@ -205,5 +182,42 @@ sub worker_loop {
>  			my $c = Dumper($o);
>  			warn "bad: $u $c\n";
>  		}
> +		if ($tidy_check) {
> +			my $raw = $r->decoded_content;

			my $raw = '<!doctype html>' . $r->decoded_content;

> +			my ($out, $err) = ('', '');
> +			my $fail = $tidy_check->(\$raw, \$out, \$err);
> +			warn "Tidy ($fail) - $u - <1:$out> <2:$err>\n" if $fail;
> +		}
> +	}
> +}

      reply	other threads:[~2019-04-28 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27 21:23 [RFC] www: set "<!DOCTYPE html>" everywhere Eric Wong
2019-04-28 22:32 ` Eric Wong [this message]

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=20190428223226.GA22804@dcvr \
    --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).