Comparing version 1.0.0 to 1.0.1
{ | ||
"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)); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
39159
970
134
1