logoalt Hacker News

kzrdudeyesterday at 10:30 AM2 repliesview on HN

It may look nested but the first p is actually closed when the second p starts, according to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...


Replies

jchwyesterday at 10:39 AM

Wouldn't this still result in just two paragraph elements? Yes, the first gets auto-closed, but I don't see how a third paragraph could emerge out of this. Surely that closing tag should just get discarded as invalid.

edit: Indeed, it creates three: the </p> seems to create an empty paragraph tag. Not the first time I've been surprised by tag soup rules.

hnlmorgyesterday at 10:48 AM

Hence why I said “2” ;)

show 1 reply