not closing tags for instance is really asking for future headaches. sure, it works for a simple text list, but not when it gets even a little complicated (add links, images, buttons, etc.). even worse are p tags, where you have to memorize a whole matrix of what it can contain and what breaks out implicitly. with every insertion/deletion, you need to check the list. it's needless mental drag.
<p><div></div></p> is invalid HTML because <div> ends the paragraph, resulting in an unpaired </p>.
I don't think that's correct. The article is literally talking about how to write HTML, and explaining the benefits of writing it in this style.
Not with that attidude... if you write consistently and with intention, it turns out just fine.
Check out the source for https://try.nodebb.org, for example. Dynamically generated, (mostly) syntactically correct, (mostly) human readable.
Isn't it a "view" of information? Any sufficiently advanced text editor can recreate it with a simple key combination.
The DOM is a tree, with nested elements. Losing that information doesn't get you anything but tag soup (which is, oddly, what the author suggests this style is supposed to avoid)
Or, to put another way, HTML != DOM, even though HTML can be rendered into a DOM.
You can’t orient yourself - you can’t tell where you are - unless you count the branches. And indenting makes that visible.
In the examples for TFA, you can tell your location from the names of the elements. Eg <td> is enough for you to know you’re probably inside a tr inside a table.
And that is the more common case than the general tree example.
But a method of describing html does have to answer the question of how it represents arbitrarily deep nesting. But I like the answers it’s given for the more common case of structures that are not arbitrarily deep.
I think that is a very compelling format for a text-first web page, like a blog post or news article. Of course it is a coding style not well suited for complex web apps with deep hierarchy.
http://info.cern.ch/hypertext/WWW/MarkUp/HTMLConstraints.htm...
What really needs to happen it a separation of HTML from UI markup elements. HTML will be used solely for textual markup and a new markup language can be used for UIs. This would allow us to return to a proper separation of concerns.
Do you mean CSS? Using <b>, <I>, <strong>, etc has been “bad form” for a while (maybe not strong though)