3 ms·
> Notice that, when writing html5 by hand, you can use the full power of the language, most notably optional tags (no need to write html, body, etc) and auto-cl
by susam 2y ago
> Notice that, when writing html5 by hand, you can use the full power of the language, most notably optional tags (no need to write html, body, etc) and auto-closing tags (no need to close p, li, td, etc). You may get something even crispier!
Yes! In fact, sometime back I wrote a little demo page to show the minimal (but not code-golfed) HTML we can write such that it passes validation both with the Nu HTML Checker and HTML Tidy.
Here's the demo page: https://susam.net/code/web/minimal.html https://susam.net/code/web/minimal.html
Here's the Nu HTML Checker output: https://validator.w3.org/nu/?doc=https%3A%2F%2Fsusam.net%2Fcode%2Fweb%2Fminimal.html https://validator.w3.org/nu/?doc=https%3A%2F%2Fsusam.net%2Fc...
Here's the HTML Tidy (version 5.8.0) output:
$ tidy -quiet -errors minimal.html
$
Here's the HTML:
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Hello</title>
<body>
<p>Hello, World!
That said, when writing my own posts, I prefer keeping optional and closing tags intact. Since I use Emacs, I can insert and indent closing tags effortlessly with C-c /. It's a bit like how some people write:
10 PRINT"HELLO
But I've always preferred:
10 PRINT "HELLO"
I find the extra structure more aesthetically pleasing.