HTML Lint is a tool that makes sure your code looks good. While XHTML was very strict with syntax HTML 5 is more lenient like previous versions of HTML, which means keeping consistent code styles will become more difficult. Validating is not good enough anymore.
HTML Lint is under constant development. If you find a bug, report it on Twitter.
As code styles differ HTML Lint allows you to set what you want it to check for.
Some HTML elements may have their closing tag omitted. You can find all of them in the specification, but the most common are <li>, <tr>, <td>, <th>.
With this option turned on, you must provide a closing tag for all these elements.
You can write tags in any case you want. Use this option if you want to require all tags to be lowercase (as they must be in XHTML).
HTML void elements must not have a closing tag. All such elements are listed in the specification, but the most common are <br>, <hr>, <img>, <link>, <meta>, <input>, <param>.
Empty elements must be closed in XHTML by using the empty-element tag form (<tag />). With this option turned on, Lint will require all empty tags to be closed.
HTML allows unquoted attribute-value syntax where the value of the attribute is not quoted. Use this option to require use of quotes around attribute values (a pair of single or double quotes) as required by XHTML.
As with tags, you can write attribute names in any case you want. Use this option if you want to require all tags to be lowercase (as they must be in XHTML).
HTML allows empty attribute syntax where a boolean attribute is set by only adding its name and no value (in fact any value will set it to True). Use this option to conform to XHTML that does not allow this form and suggests a name="name" syntax.
Turning this option on will require you to open and close an element with tags indented equally. This makes reading code and finding mistakes easier even without validation.
You can also use our API to get results back from HTML Lint. Current limit is 20 requests every 3 minutes.
The spec for the API below tells you which parameters you need to send to Lint to get it to work.
API endpoint: http://lint.brihten.com/html/lint/
The content you need Linted must be smaller than 1MB. Contact us if that is not enough.
Make sure that encoding is "multipart/form-data".
All these are booleans for the Lint options. Set them to false by sending False, false, 0 or an empty value. Anything else is true.
Currently the only possible values are "json" and "xml".
http://lint.brihten.com/html/lint/?url=http%3A%2F%2Fmmm.si%2F&tags_whitespace=trueLint will not report on anything that should be reported by the validator. It will however stop parsing when it reaches illegally closed tags, as it then cannot know what you wanted to do.
If you think that something is not reported by Lint but should be, contact us.
If you think that something is reported by Lint but shouldn't be, contact us.
Lint will behave weirdly when it encounters a < or > inside the attributes of an element. The spec says that attribute values are in general "Normal character data", which means that all characters except "<" are allowed (and in case of quoted attributes also the quote used to quote the value - single or double).
Lint discourages the use of < or > inside attribute values - you should use the corresponding character references.
When using unquoted attribute values there must be at least one whitespace character between the value and the / character if the tag is an empty-element tag. This is not yet reported by Lint.
Another issue is the characters in the unquoted value - the spec says that the value must not containt certain characters (", ', >, =) but this is not enforced yet.
According to the spec the attributes are defined as [name][WHITESPACE]=[WHITESPACE][value] (in case of quoted attribute values there must be a single ' or " character around the value).
The [WHITESPACE] is not allowed by Lint.
Lint is written in Python and the webapp is based on Django. The code for both will be available on github soon.
HTML Lint is a project of MMM. Code written mostly by Marko Mrdjenovič, python help and Django app by Marko Samastur, design by Sara Tušar.