Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-to-react

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-react - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

6

lib/utils.js

@@ -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: &quot;Open Sans&quot;;"></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>';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc