diff --git a/lib/utils.js b/lib/utils.js index 69735af..68f99f6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -11,6 +11,11 @@ function createStyleJsonFromString(styleString) { var singleStyle, key, value, jsonStyles = {}; for (var i = 0; i < styles.length; ++i) { singleStyle = styles[i].split(':'); + + if (singleStyle.length > 2) { + singleStyle[1] = singleStyle.slice(1).join(':'); + } + key = camelize(singleStyle[0]); value = singleStyle[1]; if (key.length > 0 && value.length > 0) { diff --git a/test/html-to-react-tests.js b/test/html-to-react-tests.js index 6036cf2..4433689 100644 --- a/test/html-to-react-tests.js +++ b/test/html-to-react-tests.js @@ -31,7 +31,7 @@ describe('Html2React', function () { }); it('should return a valid HTML string with inline styles', function () { - var htmlInput = '
'; var reactComponent = parser.parse(htmlInput);