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

I don't think the gp was saying this is a new thing, just an old thing that never made sense to her/him.

That looks like a very nice resource though, thank you.




Indeed.

And to be fair, I'm actually somewhat ok with self closing tags. Though, I can't easily see why I'd want tags that can't self close.


To be clear, HTML's "self-closing elements" are img, meta, and others which never have content nor end-element tags. These are based on SGML empty elements, and HTML merely tolerates the XML-style form

    <img ... />
but does not allow

    <img ...></img>
though parser recovery might be able to deal with it, and WebSGML can formally reject or accept it.

Apart from empty elements, HTML's tag inference can also be formalized using SGML. Tag inference is what makes this

    <title>Title</title>
    <p>Body Text
a valid HTML document and be treated as though

    <html
      <head>
        <title>Title</title>
      </head>
      <body>
        <p>Body Text</p>
      </body>
    </html>
had been written.


Right, the "self-closing elements" don't actually bother me. I do slightly prefer the <foo /> form, but in general I don't care. What used to baffle me was I couldn't do a "<div />" as that wasn't allowed. And I couldn't think of a good reason to care on that. (It seemed you had to go out of your way to disallow that, for no apparent reason.)

The tag inference, I just don't get. I can /almost/ understand the example you used, but the examples include crap like:

    <table>
      <thead>
        <tr>
        <tr>
Where the second "<tr>" is actually part of the inferred "<tbody>". Just, why?

Edit: And to be perfectly clear, I do expect most of this to be handled for me by whatever framework I'm using nowdays. And, I don't actually generate documents directly that much. For docs, I typically go with LaTeX or friends. (Honestly, probably org-mode moreso, but even that is light nowdays.)


Well, in my paper, like you, I'm criticizing (tag omission in) HTML5's table content models, and discourage aggressive use of it ([1]), so probably I'm not the one to defend it ;)

Even the HTML specification text itself got its tables wrong ([2]; also explained in [1]).

[1]: <http://sgmljs.net/docs/html5.html#start--and-end-element-tag...

[2]: <https://github.com/whatwg/html/commit/6e305c457e42276bf275b8...


Apologies, I did not mean for you to be on a defensive. Just adding to the point. If anyone skipped your link, they shouldn't have. Thanks for sharing!




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

Search: