Comment by jakelazaroff

Comment by jakelazaroff 10 hours ago

2 replies

The inert self closing syntax is misleading, though, because if you use it for a non-void element then whatever follows will be contained within the tag.

e.g. how do you think a browser will interpret this markup?

    <div />
    <img />
A lot of people think it ends up like this (especially because JSX works this way):

    <div></div>
    <img>
but it's actually equal to this:

    <div>
        <img>
    </div>
xg15 10 hours ago

Ah, that's true. I think the WHATWG discouraged the syntax, so this might be why.

ricardobeat 10 hours ago

This is really easy to detect though, unlike arbitrary rules on what belongs on the inside of an unclosed tag.