Skip to content

Commit

Permalink
Disable rule at false value
Browse files Browse the repository at this point in the history
  • Loading branch information
shootaroo committed Dec 17, 2013
1 parent e200a41 commit 562645a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ var HTMLHint = (function (undefined) {
var rules = HTMLHint.rules,
rule;
for (var id in ruleset){
rule = rules[id];
if (rule !== undefined){
rule.init(parser, reporter, ruleset[id]);
if (ruleset[id]) {
rule = rules[id];
if (rule !== undefined){
rule.init(parser, reporter, ruleset[id]);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions test/rules/attr-lowercase.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ describe('Rules: '+ruldId, function(){
expect(messages.length).to.be(0);
});

it('Set is false not result in an error', function(){
var code = '<p TEST="abc">';
ruleOptions[ruldId] = false;
var messages = HTMLHint.verify(code, ruleOptions);
expect(messages.length).to.be(0);
});
});

0 comments on commit 562645a

Please sign in to comment.