File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
var utilities = require ( './utilities' ) ;
7
7
var propertyConfig = require ( './property-config' ) ;
8
- var parser = require ( 'style-to-object' ) ;
8
+ var styleToObject = require ( 'style-to-object' ) ;
9
9
var config = propertyConfig . config ;
10
10
var isCustomAttribute = propertyConfig . HTMLDOMPropertyConfig . isCustomAttribute ;
11
11
@@ -66,8 +66,11 @@ function cssToJs(style) {
66
66
67
67
var styleObj = { } ;
68
68
69
- parser ( style , function ( propName , propValue ) {
70
- styleObj [ utilities . camelCase ( propName ) ] = propValue ;
69
+ styleToObject ( style , function ( propName , propValue ) {
70
+ // Check if it's not a comment node
71
+ if ( propName && propValue ) {
72
+ styleObj [ utilities . camelCase ( propName ) ] = propValue ;
73
+ }
71
74
} ) ;
72
75
73
76
return styleObj ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var _hyphenPattern = / - ( .) / g;
4
+
3
5
/**
4
6
* Convert a string to camel case.
5
7
*
6
8
* @param {String } string - The string.
7
9
* @return {String }
8
10
*/
9
-
10
- var _hyphenPattern = / - ( .) / g;
11
-
12
11
function camelCase ( string ) {
13
12
if ( typeof string !== 'string' ) { // null is an object
14
13
throw new TypeError ( 'First argument must be a string' ) ;
Original file line number Diff line number Diff line change 31
31
"dependencies" : {
32
32
"html-dom-parser" : " 0.1.2" ,
33
33
"react-dom-core" : " 0.0.2" ,
34
- "style-to-object" : " ^ 0.2.0"
34
+ "style-to-object" : " 0.2.0"
35
35
},
36
36
"devDependencies" : {
37
37
"coveralls" : " ^2.13.1" ,
You can’t perform that action at this time.
0 commit comments