domhandler
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -46,4 +46,5 @@ var ElementType = require("./ElementType.js"), | ||
DomHandler.prototype._addDomElement = function(element){ | ||
var lastTag = element.parent = this._tagStack[this._tagStack.length - 1]; | ||
var lastTag = this._tagStack[this._tagStack.length - 1]; | ||
if(!lastTag){ //There aren't parent elements | ||
@@ -54,8 +55,4 @@ this.dom.push(element); | ||
if(lastTag.children === null){ | ||
lastTag.children = [element]; | ||
return; | ||
} | ||
if(DomUtils.isTag(element)){ | ||
element.parent = lastTag; | ||
var idx = lastTag.children.length; | ||
@@ -79,5 +76,6 @@ while(idx > 0){ | ||
attribs: attribs, | ||
children: null, | ||
children: [], | ||
prev: null, | ||
next: null | ||
next: null, | ||
parent: null | ||
}; | ||
@@ -84,0 +82,0 @@ this._addDomElement(element); |
{ | ||
"name": "domhandler", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "htmlparser2's dom as a separate module", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
25668
984