Giter Club home page Giter Club logo

html_validator's Introduction

An HTML Validator in Javascript (Insert catchy name here)

Are you fed up of using slow, server side validators with obscure error messages? Maybe you aren't, but as a Chrome developer I am, because there is no decent HTML validation solution. The aim of this project is this:

  • To allow anyone on any browser be able to validate HTML, either using a bookmarklet or browser extension
  • To support the major doctypes: HTML 4.01, XHTML 1.0 and eventually HTML 5
  • To provide a plain English, sensible version of the W3C HTML spec

I'd also like to use the platform to create an experimental doctype for best practice HTML, which would evolve with the web.

TODO

  • Add doctype detection
  • Check code ignores comments/text where appropriate
  • Differentiate between cdata and whitespace
  • Check XHTML closing tags / not self closing
  • Ask John Resig about weird regex
  • Investigate escaped attribute value regex
  • Log CDATA/comment sections in cdata
  • Fix problem with frameset as frameset child
  • Add a lateral stack to find mistakenly closed unary elements
  • Rename tag to element where appropriate
  • Integrate as jQuery plugin, with AJAX call
  • Create XHTML 1.0 doctype
  • Create HTML 5 doctype
  • Create lots of tests!

The Parser

Here I'll explain how the parser works, some of the intricacies of HTML, and how they are handled by the parser.

#Doctypes

Here I'll explain the format of the doctypes.

#HTML Doctype Bugs

  • object in head can contain content
  • object in head can contain head elements
  • Textarea can contain del/ins
  • Noscript can contain script
  • li types are only specified in comment (transitional)
  • id does not allow multiple ids (give example)
  • class attribute does not have any kind of constraint
  • html special chars do not require escaping, except quotes in attributes

#HTML W3C Validator Bugs

  • Fails when implicit tags have no children (e.g. table has no tbody or tbody children)

html_validator's People

Contributors

peterjwest avatar

Watchers

 avatar James Cloos avatar Krystian Kuczek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.