I want to know if there's an existing Javascript library for validating HTML, preferably not one that relies on a web API.
The closest I've found to this is John Resig's HTML parser, but that seems to be more about fixing HTML and converting it to XML.
So is there something out there already? And if not, how difficult (and lengthy) would it be to adapt John Resig's parser?
Take checkHTML("<p>Test<P>test") for instance. That is perfectly valid HTML, but the browser will normalize it when it pulls it back out of innerHTML . There will be no text outside an element in the DOM generated from that valid HTML.
An HTML validator is a quality assurance program used to check Hypertext Markup Language ( HTML ) markup elements for syntax errors. A validator can be a useful tool for an HTML user who receives data electronically from a variety of input sources.
An HTML validator is a specialized program or application used to check the validity of HTML markup in a Web page for any syntax and lexical errors.
No, there isn't one. However I am writing one: https://github.com/peterjwest/html_validator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With