|
i haven't tested it, but MDN says: "The end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element" (i.e. the things that aren't valid children for a <p>, iirc) so i believe your example would end up parsing as <div>
<p></p>
<h1></h1>
<h2></h2>
</div>
and not as <div>
<p>
<h1>
<h2></h2>
</h1>
</p>
</div>
(i'm not sure how exactly the <h1>/<h2> would behave - an <h1> can't have an <h2> child, but they don't have self-closing rules. it's probably in the spec somewhere) |