Skip to content

Commit

Permalink
Merge pull request #13 from shootaroo/rule-disable
Browse files Browse the repository at this point in the history
Disable rule at false value
  • Loading branch information
yaniswang committed Jun 14, 2014
2 parents 3bfaeaf + d420c14 commit 52eac81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ var HTMLHint = (function (undefined) {
rule;
for (var id in ruleset){
rule = rules[id];
if (rule !== undefined){
rule.init(parser, reporter, ruleset[id]);
if (rule !== undefined && ruleset[id] !== false){
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 52eac81

Please sign in to comment.