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.1 to 1.4.2

.yourbase.yml

4

CHANGELOG.md
# Change Log
## [v1.4.2](https://github.com/aknuds1/html-to-react/tree/v1.4.2)
- Support onclick attribute of HTML elements
## [v1.4.1](https://github.com/aknuds1/html-to-react/tree/v1.4.1)

@@ -3,0 +7,0 @@

2

lib/camel-case-attribute-names.js

@@ -22,3 +22,3 @@ // These are all sourced from https://facebook.github.io/react/docs/tags-and-attributes.html -

'step', 'style', 'summary', 'tabIndex', 'target', 'title', 'type', 'useMap', 'value', 'width',
'wmode', 'wrap',
'wmode', 'wrap', 'onClick',
];

@@ -25,0 +25,0 @@

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

}
if (typeof value === 'string') {
value = value;
}
result[key] = value || key;

@@ -52,0 +49,0 @@ return result;

{
"name": "html-to-react",
"version": "1.4.1",
"version": "1.4.2",
"description": "A lightweight library that converts raw HTML to a React DOM structure.",

@@ -48,3 +48,3 @@ "main": "index.js",

"coveralls": "^3.0.6",
"eslint": "^6.1.0",
"eslint": "^6.4.0",
"istanbul": "^0.4",

@@ -51,0 +51,0 @@ "mocha": "^6.2.0",

@@ -270,2 +270,10 @@ 'use strict';

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

@@ -272,0 +280,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