aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/simpleRuleSet1.json
blob: 5b4fd9588a43bd5aac2a5d0c12d242aafc18348f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ "name": "Simple Rule Set 1"
, "description": "A trivila rule set for experimentation."
, "rules": [
//---
          { "id":42
             , "name": "Headings are capitalized"
             , "description": "Check to see if all h1 headings use leading capital letters."
             , "rule":
               function() {
                 var badHeadings = $('h1').filter(function(idx) {
                                                    var ch = $(this).text()[0];
                                                    if (ch) {
                                                      return (ch == ch.toLowerCase() );
                                                    } else {
                                                      return false;
                                                    }
                                                  });
                 $(badHeadings).map(function(idx, elt){
                                      report('Heading does not start with a capitol letter.', elt);
                 });

               }//,
//---
           }]
}