File tree 2 files changed +3
-23
lines changed
2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change 1
1
var 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' ) ;
23
3
24
4
module . exports = function ( tag ) {
25
5
var i = 0 ;
@@ -37,7 +17,7 @@ module.exports = function (tag) {
37
17
key = match ;
38
18
} else {
39
19
if ( i === 0 ) {
40
- if ( lookup [ match ] || tag . charAt ( tag . length - 2 ) === '/' ) {
20
+ if ( voidElements [ match ] || tag . charAt ( tag . length - 2 ) === '/' ) {
41
21
res . voidElement = true ;
42
22
}
43
23
res . name = match ;
Original file line number Diff line number Diff line change 7
7
"url" : " https://github.com/rayd/html-parse-stringify2/issues"
8
8
},
9
9
"dependencies" : {
10
- "void-elements" : " ^1 .0.0 "
10
+ "void-elements" : " ^2 .0.1 "
11
11
},
12
12
"devDependencies" : {
13
13
"jshint" : " ^2.5.10" ,
You can’t perform that action at this time.
0 commit comments