File tree Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change 11var attrRE = / ( [ \w - ] + ) | ( [ ' " ] ) ( [ . \s \S ] * ?) \2/ g;
2-
3- // create optimized lookup object for
4- // void elements as listed here:
5- // http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
6- var lookup = ( Object . create ) ? Object . create ( null ) : { } ;
7- lookup . area = true ;
8- lookup . base = true ;
9- lookup . br = true ;
10- lookup . col = true ;
11- lookup . embed = true ;
12- lookup . hr = true ;
13- lookup . img = true ;
14- lookup . input = true ;
15- lookup . keygen = true ;
16- lookup . link = true ;
17- lookup . menuitem = true ;
18- lookup . meta = true ;
19- lookup . param = true ;
20- lookup . source = true ;
21- lookup . track = true ;
22- lookup . wbr = true ;
2+ var voidElements = require ( 'void-elements' ) ;
233
244module . exports = function ( tag ) {
255 var i = 0 ;
@@ -37,7 +17,7 @@ module.exports = function (tag) {
3717 key = match ;
3818 } else {
3919 if ( i === 0 ) {
40- if ( lookup [ match ] || tag . charAt ( tag . length - 2 ) === '/' ) {
20+ if ( voidElements [ match ] || tag . charAt ( tag . length - 2 ) === '/' ) {
4121 res . voidElement = true ;
4222 }
4323 res . name = match ;
Original file line number Diff line number Diff line change 77 "url" : " https://github.com/rayd/html-parse-stringify2/issues"
88 },
99 "dependencies" : {
10- "void-elements" : " ^1 .0.0 "
10+ "void-elements" : " ^2 .0.1 "
1111 },
1212 "devDependencies" : {
1313 "jshint" : " ^2.5.10" ,
You can’t perform that action at this time.
0 commit comments