Socket
Socket
Sign inDemoInstall

domhandler

Package Overview
Dependencies
1
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.0.3

LICENSE

38

index.js

@@ -95,11 +95,18 @@ var ElementType = require("domelementtype");

var lastTag;
if(this._tagStack.length){
var lastTag;
if(
(lastTag = this._tagStack[this._tagStack.length - 1]) &&
(lastTag = lastTag.children[lastTag.children.length - 1]) &&
lastTag.type === ElementType.Text
){
lastTag.data += data;
return;
if(
(lastTag = this._tagStack[this._tagStack.length - 1]) &&
(lastTag = lastTag.children[lastTag.children.length - 1]) &&
lastTag.type === ElementType.Text
){
lastTag.data += data;
return;
}
} else {
if(this.dom.length && this.dom[this.dom.length-1].type === ElementType.Text){
this.dom[this.dom.length-1].data += data;
return;
}
}

@@ -130,13 +137,8 @@

//TODO remove duplicated code
DomHandler.prototype.oncdata = function(data){
var lastTag = this._tagStack[this._tagStack.length - 1];
if(lastTag && lastTag.type === ElementType.CDATA){
lastTag.data += data;
return;
}
DomHandler.prototype.oncdatastart = function(){
var element = {
data: data,
children: [{
data: "",
type: ElementType.Text
}],
type: ElementType.CDATA

@@ -143,0 +145,0 @@ };

{
"name": "domhandler",
"version": "2.0.2",
"description": "htmlparser2's dom as a separate module",
"version": "2.0.3",
"description": "handler for htmlparser2 that turns pages into a dom",
"main": "index.js",

@@ -6,0 +6,0 @@ "directories": {

@@ -17,9 +17,4 @@ {

"type": "text"
},
{
"type": "tag",
"name": "br",
"attribs": {}
}
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc