New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.4.6 to 1.4.7

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Change Log

## [v1.4.7](https://github.com/aknuds1/html-to-react/tree/v1.4.7)
- Make sure event handlers, f.ex. "onclick", are functions [#126](https://github.com/aknuds1/html-to-react/pull/126) ([aknuds1](https://github.com/aknuds1))
## [v1.4.6](https://github.com/aknuds1/html-to-react/tree/v1.4.6)

@@ -7,0 +11,0 @@

@@ -5,2 +5,3 @@ 'use strict';

const reduce = require('ramda/src/reduce');
const startsWith = require('ramda/src/startsWith');
const React = require('react');

@@ -78,2 +79,4 @@ const includes = require('ramda/src/includes');

key = 'htmlFor';
} else if (startsWith('on', key)) {
value = Function(value);
}

@@ -80,0 +83,0 @@

2

package.json
{
"name": "html-to-react",
"version": "1.4.6",
"version": "1.4.7",
"description": "A lightweight library that converts raw HTML to a React DOM structure.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -273,7 +273,8 @@ 'use strict';

it('should handle onclick attributes', function () {
const htmlInput = '<button onclick="alert(\'hello!\')">Hello</button>';
const htmlInput = `<button onclick="alert('hello!')">Hello</button>`;
const reactElem = parser.parse(htmlInput);
assert.strictEqual(reactElem.props.onClick, 'alert(\'hello!\')');
assert.strictEqual(typeof reactElem.props.onClick, 'function');
assert.strictEqual(String(reactElem.props.onClick), String(Function(`alert('hello!')`)));
});

@@ -280,0 +281,0 @@

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