Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a pure Javascript X/HTML validator? [closed]

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?

like image 243
peterjwest Avatar asked Apr 27 '11 19:04

peterjwest


People also ask

How do you check is HTML valid or not?

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.

Which tool is used to check the validity of 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.

What is an HTML5 code validator?

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.


1 Answers

No, there isn't one. However I am writing one: https://github.com/peterjwest/html_validator

like image 104
peterjwest Avatar answered Sep 21 '22 16:09

peterjwest