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

htmldom

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmldom - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

25

beautify/index.js

@@ -26,2 +26,6 @@ var util = require('utils-extend');

function hasTag (tags) {
return tags.find(item => item.type === 'tag')
}
module.exports = function(nodes, options) {

@@ -49,3 +53,3 @@ var html = [];

if (value) {
html.push(newline + value);
html.push(value);
}

@@ -59,3 +63,4 @@ break;

}
html.push(newline + '<!--' + dom.value + '-->');
html.push('<!--' + dom.value + '-->');
break;

@@ -93,5 +98,14 @@ case 'tag':

} else {
dom.children.forEach(function(item) {
html.push(recurse(item, depth + 1));
});
// Has children tag indent
if (hasTag(dom.children)) {
dom.children.forEach(function(item) {
html.push(recurse(item, depth + 1));
});
} else {
newline = ''
dom.children.forEach(function(item) {
html.push(recurse(item, depth));
});
}
}

@@ -105,2 +119,3 @@ html.push(newline + '</' + name + '>');

for (var i = 0, l = nodes.length; i < l; i++) {

@@ -107,0 +122,0 @@ html.push(recurse(nodes[i], 0));

4

lib/scanner.js

@@ -118,3 +118,3 @@ var REG = require('./reg');

var dom = {
name: name.toLowerCase(),
name: name,
attributes: attrs

@@ -177,3 +177,3 @@ };

type: 'closetag',
name: tagname.toLowerCase()
name: tagname
});

@@ -180,0 +180,0 @@ return true;

{
"name": "htmldom",
"version": "3.0.4",
"version": "3.0.5",
"description": "Simplified html handle in nodejs",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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