From 25843ac064c7099f412d6f4f4b9972e9069dc98b Mon Sep 17 00:00:00 2001 From: Aaron K Date: Mon, 3 Sep 2018 10:01:26 -0500 Subject: [PATCH] chore(htmlhint): adding support for a white list of elements that can be lower case. (#188) When enabling the rule instead of using a boolean, use an array with the attributes (camelCased) that you want to ignore ```json { "tagname-lowercase": ["clipPath"] } ``` --- src/rules/tagname-lowercase.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rules/tagname-lowercase.js b/src/rules/tagname-lowercase.js index 3ae51fdc2..a01d22e3f 100644 --- a/src/rules/tagname-lowercase.js +++ b/src/rules/tagname-lowercase.js @@ -1,11 +1,12 @@ HTMLHint.addRule({ id: 'tagname-lowercase', description: 'All html element names must be in lowercase.', - init: function(parser, reporter){ + init: function(parser, reporter, options){ var self = this; + var exceptions = Array.isArray(options) ? options : []; parser.addListener('tagstart,tagend', function(event){ var tagName = event.tagName; - if(tagName !== tagName.toLowerCase()){ + if (exceptions.indexOf(tagName) === -1 && tagName !== tagName.toLowerCase()){ reporter.error('The html element name of [ '+tagName+' ] must be in lowercase.', event.line, event.col, self, event.raw); } });