All notable changes to this project will be documented in this file.
v1.6.0 - 2017-07-06
- Boolean attributes in all the allowed variations forms are now parsed and included in the AST
<input checked>
<input checked="true">
<input checked="">
- Allow unambiguous ampersands (
&
) in double-quoted attribute values. Ampersands are allowed EXCEPT when they come in the form of a named reference (e.g.,&something;
) wheresomething
is not a valid named reference from this list.
v1.5.0 - 2016-06-14
-
Added
preserveCase
option to allow validation of Angular 2 templates. Here is a combination of settings and configuration that appears to work well for Angular 2.{ settings: { preserveCase: true }, tags: { normal: [ 'template' ] }, attributes: { '_': { mixed: /^((\*ng)|(^\[[\S]+\]$)|(^\([\S]+\)$))|(^\[\([\S]+\)\]$)/ } } }
v1.4.0 - 2016-03-08
- Consolidated rules for text nodes,
doctype
tags, and whitespace to increase the parsing performance.
- The more self closing tags that are present in a document, the longer the document takes to parse, and this is causing the process to run out of memory while processing large documents with lots of self closing tags.
v1.2.0 - 2016-02-19
- Added
verbose
setting to create a verbose AST instead of the default AST. As of right now, this mode will tell you whether an attribute was quoted or unquoted but will be extended with additional information in the future.
v1.1.0 - 2015-08-07
- Definition for synchronous usage was incorrect in
htmlTagValidator()
- Tests to verify that
htmlTagValidator()
can be called synchronously or asynchronously
v1.0.8 - 2015-05-14
- Encoding error in codex file that contained odd tab character
v1.0.7 - 2015-05-14
- Updated
markdown
,html
andplain
output for validation error output
v1.0.6 - 2015-05-14
- Gruntfile now set to monitor all project files in
grunt debug
watcher
- Main exported function for this library can now work synchronously or asynchronously
var validator = require('html-tag-validator');
// sync
var ast = validator("<p></p>", { 'settings': { 'format': 'html' } });
// async
validator("<p></p>", { 'settings': { 'format': 'html' } }, function (err, ast) {
if (err) {
throw err;
} else {
console.log(JSON.stringify(ast));
}
});
- Global
settings
for error outputformat
as'plain'
,'html'
, or'markdown'
- Escaping functions for identifiers and other values (for validation message generation)
- Added
conditional
andconditions
sections toattributes
definitions in theoptions
object, so that conditional rules on allowed attributes can be written easier (e.g.: if thetype
attribute isradio
then allow attributeschecked
andrequired
on aninput
element, in addition to theglobal
andevent
attributes) - Testing: added ability to do deep equals against two HTML trees using
tree.equals()
v1.0.5 - 2015-05-07
-
Quoted attribute values did not follow HTML 5 spec
-
Unquoted attribute values did not follow HTML 5 spec
-
HTML parser utilities missing function
findWhere()
used byhas()
function -
Malformed starting tags gave wrong error message
<div> <p class </p> </div>
-
Having HTML or XML elements inside of a conditional comment caused parse errors
<!--[if ie]> <style> .breaking { content: "whoops!"; } </style> <![endif]-->
-
Grunt
test
anddebug
should only failOnError when running pegjs compiler
v1.0.4 - 2015-05-07
- Grunt commands
test
for running tests anddebug
for getting detailed test output and starting the file watcher
- Got rid of the dependency on
grunt-mocha-test
to run the tests
v1.0.3 - 2015-05-07
- Internal utility methods such as
textNode()
andfind()
no longer modify build-in JavaScript objects such asArray
andString
1.0.2 - 2015-05-07
- HTML encode all error messages so they can be displayed on a webpage
v1.0.0 - 2015-05-07
- Breaking changes from 0.0.x. Check README for changes to core API.