forked from ashi009/node-fast-html-parser
-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Description
Is there a reason why the following isn't parseable?
const dom1 = nodeHtmlParser.parse(`<body><main class=h-entry><p>hello</main></body>`)
console.log(dom1.querySelectorAll('.h-entry'))
It seems like the <p>
tag is not required to be closed as mentioned in the spec:
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, dialog, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, menu, nav, ol, p, pre, search, 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.
Metadata
Metadata
Assignees
Labels
No labels