File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed
Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 2424 },
2525 "homepage" : " https://github.com/molant/chai-htmlhint#readme" ,
2626 "dependencies" : {
27- "lodash" : " ^4.11.1" ,
28- "request" : " ^2.71.0"
27+ "lodash" : " ^4.11.1"
2928 }
3029}
Original file line number Diff line number Diff line change 1+ # What is chai-htmlhint
2+ chai-htmlhint is a wrapper of [ htmlhint] ( https://github.com/yaniswang/HTMLHint/ ) to use with chai.
3+
4+ # How to use it
5+ You just have to pass the html you want to validate like this:
6+ ``` javascript
7+ var myhtml = ' <h1>my html</h1>' ;
8+ expect (myhtml).to .be .validHtml ;
9+ ```
10+
11+ The default rules are:
12+ ``` json
13+ {
14+ "alt-require" : true ,
15+ "attr-lowercase" : true ,
16+ "attr-no-duplication" : true ,
17+ "attr-unsafe-chars" : true ,
18+ "attr-value-double-quotes" : true ,
19+ "doctype-first" : true ,
20+ "doctype-html5" : true ,
21+ "id-unique" : true ,
22+ "inline-script-disabled" : false ,
23+ "inline-style-disabled" : false ,
24+ "space-tab-mixed-disabled" : true ,
25+ "spec-char-escape" : true ,
26+ "src-not-empty" : true ,
27+ "style-disabled" : true ,
28+ "tag-pair" : true ,
29+ "tag-self-close" : true ,
30+ "tagname-lowercase" : true ,
31+ "title-require" : true
32+ };
33+ ```
34+
35+ If you want to override you just need a valid ` .htmlhintrc ` file in the root of your project
You can’t perform that action at this time.
0 commit comments