From e33aef9c1e8f37439156120661d419982ad961ff Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 8 Mar 2014 17:58:34 +0200 Subject: [PATCH] Enable JSHint's `newcap` option. --- .jshintrc | 2 +- src/htmlminifier.js | 2 +- src/htmlparser.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.jshintrc b/.jshintrc index b16e44f..734bdb1 100644 --- a/.jshintrc +++ b/.jshintrc @@ -8,7 +8,7 @@ "indent": 2, "laxbreak": true, "loopfunc": true, - "newcap": false, + "newcap": true, "node": true, "quotmark": "single", "strict": false, diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 2053e39..1f0cee5 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -308,7 +308,7 @@ return canTrimWhitespace(tag) || options.canTrimWhitespace(tag, attrs); } - HTMLParser(value, { + new HTMLParser(value, { html5: typeof options.html5 !== 'undefined' ? options.html5 : true, start: function( tag, attrs, unary, unarySlash ) { diff --git a/src/htmlparser.js b/src/htmlparser.js index 2d565d9..b1f389f 100644 --- a/src/htmlparser.js +++ b/src/htmlparser.js @@ -246,7 +246,7 @@ global.HTMLtoXML = function( html ) { var results = ''; - HTMLParser(html, { + new HTMLParser(html, { start: function( tag, attrs, unary ) { results += '<' + tag; @@ -321,7 +321,7 @@ // the body element var curParentNode = one.body; - HTMLParser( html, { + new HTMLParser( html, { start: function( tagName, attrs, unary ) { // If it's a pre-built element, then we can ignore // its construction -- 2.34.1