Skip to content

Commit

Permalink
add empty elements: track,command,source,keygen,wbr
Browse files Browse the repository at this point in the history
fix #111
  • Loading branch information
yaniswang committed May 1, 2016
1 parent b6a4d1a commit 591f103
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add:
3. add formatters: compact, markdown
4. add cli parameter:`--nocolor`, disable color in cli
5. space-tab-mixed-disabled plugin: add space length require
6. add empty elements: track,command,source,keygen,wbr

fix:

Expand Down
2 changes: 1 addition & 1 deletion lib/htmlhint.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/rules/tag-pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HTMLHint.addRule({
init: function(parser, reporter){
var self = this;
var stack=[],
mapEmptyTags = parser.makeMap("area,base,basefont,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track");//HTML 4.01 + HTML5
mapEmptyTags = parser.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");//HTML 4.01 + HTML 5
parser.addListener('tagstart', function(event){
var tagName = event.tagName.toLowerCase();
if (mapEmptyTags[tagName] === undefined && !event.close){
Expand Down
4 changes: 2 additions & 2 deletions src/rules/tag-self-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ HTMLHint.addRule({
description: 'Empty tags must be self closed.',
init: function(parser, reporter){
var self = this;
var mapEmptyTags = parser.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");//HTML 4.01
var mapEmptyTags = parser.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");//HTML 4.01 + HTML 5
parser.addListener('tagstart', function(event){
var tagName = event.tagName.toLowerCase();
if(mapEmptyTags[tagName] !== undefined){
Expand All @@ -17,4 +17,4 @@ HTMLHint.addRule({
}
});
}
});
});

0 comments on commit 591f103

Please sign in to comment.