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

html2json

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html2json - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "html2json",
"version": "1.0.0",
"version": "1.0.1",
"description": "html to json & json to html",

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

@@ -122,2 +122,5 @@ # html2json & json2html

- 1.0.1
- fix [#14](https://github.com/Jxck/html2json/issues/14)
before 1.0.0

@@ -124,0 +127,0 @@

@@ -17,3 +17,3 @@ (function(global) {

.replace(/<!doctype.*\>\n/, '')
.replace(/<!DOCTYPE.*\>\n/, '')
.replace(/<!DOCTYPE.*\>\n/, '');
}

@@ -69,3 +69,3 @@

// add to parents
var parent = bufArray[0];
var parent = bufArray[0] || results;
if (parent.child === undefined) {

@@ -72,0 +72,0 @@ parent.child = [];

@@ -25,2 +25,16 @@ if (typeof window === 'undefined') {

it('should parse hr', function() {
var json = {
node: 'root',
child: [
{ node: 'element', tag : 'hr' }
]
};
var html = '<hr/>';
assert.deepEqual(json, html2json(html));
assert.deepEqual(html, json2html(json));
});
it('should parse multi div', function() {

@@ -389,2 +403,6 @@ var json = {

]
},
{
node: 'element',
tag: 'hr',
}

@@ -399,3 +417,4 @@ ]

+ '<input id="execute" type="button" value="execute"/>'
+ '</div>';
+ '</div>'
+ '<hr/>';

@@ -402,0 +421,0 @@ assert.deepEqual(json, html2json(html));

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