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 55 */
66var utilities = require ( './utilities' ) ;
77var propertyConfig = require ( './property-config' ) ;
8- var parser = require ( 'style-to-object' ) ;
8+ var styleToObject = require ( 'style-to-object' ) ;
99var config = propertyConfig . config ;
1010var isCustomAttribute = propertyConfig . HTMLDOMPropertyConfig . isCustomAttribute ;
1111
@@ -66,8 +66,11 @@ function cssToJs(style) {
6666
6767 var styleObj = { } ;
6868
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+ }
7174 } ) ;
7275
7376 return styleObj ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ var _hyphenPattern = / - ( .) / g;
4+
35/**
46 * Convert a string to camel case.
57 *
68 * @param {String } string - The string.
79 * @return {String }
810 */
9-
10- var _hyphenPattern = / - ( .) / g;
11-
1211function camelCase ( string ) {
1312 if ( typeof string !== 'string' ) { // null is an object
1413 throw new TypeError ( 'First argument must be a string' ) ;
Original file line number Diff line number Diff line change 3131 "dependencies" : {
3232 "html-dom-parser" : " 0.1.2" ,
3333 "react-dom-core" : " 0.0.2" ,
34- "style-to-object" : " ^ 0.2.0"
34+ "style-to-object" : " 0.2.0"
3535 },
3636 "devDependencies" : {
3737 "coveralls" : " ^2.13.1" ,
You can’t perform that action at this time.
0 commit comments