validate-html-nesting
Parent-child nesting validation library for HTML
validate-html-nesting is a parent-child nesting validation library for HTML. It detects element nesting that causes browsers to modify the DOM structure - for example, placing an <hr> inside a <p> causes the browser to split the paragraph, which the library flags as invalid, regardless of HTML spec validity.
This library is being used by popular frameworks like Vue.js and Solid.js with over 150k downloads weekly!
Markup
Browser output
Usage
This library is designed to be used internally in frameworks who need to ensure rendered DOM matches authored markup - specially when the framework relies on compilation