html-to-react
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -10,8 +10,6 @@ 'use strict'; | ||
function createStyleJsonFromString(styleString) { | ||
if (!styleString) { | ||
return {}; | ||
} | ||
styleString = ent.decode(styleString || ''); | ||
var styles = styleString.split(';'); | ||
var singleStyle, key, value, jsonStyles = {}; | ||
for (var i = 0; i < styles.length; i++) { | ||
for (var i = 0; i < styles.length; ++i) { | ||
singleStyle = styles[i].split(':'); | ||
@@ -18,0 +16,0 @@ key = camelize(singleStyle[0]); |
{ | ||
"name": "html-to-react", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "A lightweight library that converts raw HTML to a React DOM structure.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -72,3 +72,3 @@ # html-to-react | ||
var isValidNode = function() { | ||
var isValidNode = function () { | ||
return true; | ||
@@ -82,6 +82,6 @@ }; | ||
// Custom <h1> processing | ||
shouldProcessNode: function(node) { | ||
shouldProcessNode: function (node) { | ||
return node.parent && node.parent.name && node.parent.name === 'h1'; | ||
}, | ||
processNode: function(node, children) { | ||
processNode: function (node, children) { | ||
return node.data.toUpperCase(); | ||
@@ -91,3 +91,3 @@ } | ||
// Anything else | ||
shouldProcessNode: function(node) { | ||
shouldProcessNode: function (node) { | ||
return true; | ||
@@ -154,3 +154,3 @@ }, | ||
var isValidNode = function() { | ||
var isValidNode = function () { | ||
return true; | ||
@@ -157,0 +157,0 @@ }; |
@@ -33,3 +33,4 @@ 'use strict'; | ||
it('should return a valid HTML string with inline styles', function () { | ||
var htmlInput = '<div style="background-color: red;color: white;"></div>'; | ||
var htmlInput = '<div style="background-color: red;color: white;' + | ||
'font-family: "Open Sans";"></div>'; | ||
@@ -398,3 +399,3 @@ var reactComponent = parser.parse(htmlInput); | ||
describe('parsing multiple elements', function() { | ||
describe('parsing multiple elements', function () { | ||
it('should result in a list of React elements', function () { | ||
@@ -401,0 +402,0 @@ var htmlInput = '<div></div><div></div>'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1491360
19730