From db994d73b9efde4f0709bf1882294a723421e8b9 Mon Sep 17 00:00:00 2001 From: molant Date: Fri, 15 Apr 2016 10:43:52 -0700 Subject: [PATCH] Adding support for a white list of attributes that can be lower case. When enabling the rule instead of using a boolean, use an array with the attributes (camelCased) that you want to ignore ```json { "attr-lowercase": ["viewBox"] } ``` Fixes #28 --- src/rules/attr-lowercase.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rules/attr-lowercase.js b/src/rules/attr-lowercase.js index 30a3ecb28..058d24d95 100644 --- a/src/rules/attr-lowercase.js +++ b/src/rules/attr-lowercase.js @@ -5,8 +5,9 @@ HTMLHint.addRule({ id: 'attr-lowercase', description: 'All attribute 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', function(event){ var attrs = event.attrs, attr, @@ -14,10 +15,10 @@ HTMLHint.addRule({ for(var i=0, l=attrs.length;i