Hacker News new | past | comments | ask | show | jobs | submit login

I rarely ^U nowadays, but your site was so clean that I couldn't resist!

Just as a side note : 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!

See for a reference the google html style guide : https://google.github.io/styleguide/htmlcssguide.html#Option...

And the official html5 reference for a complete list of optional tags : https://html.spec.whatwg.org/multipage/syntax.html#syntax-ta...




> 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

Here's the Nu HTML Checker output: 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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: