<p>包不住<div>是强制的 w3c 标准?还是约定成俗的规范?
Tag omission in text/html:
A p element’s end tag can be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.
p 允许 Phrasing content
div 不是 Phrasing content
但是,由于自动闭合规则存在,所以<p><div></div>是合法的,多余的</p>才是不合法的,标准似乎没有规定多余的</p>的处理方案,有一个方法就是给他补一个<p>,于是变成<p><div></div><p></p>