Socket
Socket
Sign inDemoInstall

clean-html

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-html - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

67

index.js

@@ -22,14 +22,3 @@ const htmlparser = require('htmlparser2');

'track',
'wbr',
// common self closing svg elements
'circle',
'ellipse',
'line',
'path',
'polygon',
'polyline',
'rect',
'stop',
'use'
'wbr'
];

@@ -41,5 +30,5 @@

options = {
'allow-attributes-without-values': false,
'break-around-comments': true,
'break-around-tags': [
'allow-attributes-without-values': opt['allow-attributes-without-values'] === true ? true : false,
'break-around-comments': opt['break-around-comments'] === false ? false : true,
'break-around-tags': opt['break-around-tags'] || [
'blockquote',

@@ -65,11 +54,13 @@ 'body',

],
'decode-entities': false,
'indent': ' ',
'lower-case-tags': true,
'lower-case-attribute-names': true,
'preserve-tags': [
'decode-entities': opt['decode-entities'] === true ? true : false,
'indent': opt['indent'] || ' ',
'lower-case-tags': opt['lower-case-tags'] === false ? false : true,
'lower-case-attribute-names': opt['lower-case-attribute-names'] === false ? false : true,
'preserve-tags': opt['preserve-tags'] || [
'math',
'script',
'style'
'style',
'svg'
],
'remove-attributes': [
'remove-attributes': opt['remove-attributes'] || [
'align',

@@ -86,29 +77,11 @@ 'bgcolor',

],
'remove-comments': false,
'remove-empty-tags': [],
'remove-tags': [
'remove-comments': opt['remove-comments'] === true ? true : false,
'remove-empty-tags': opt['remove-empty-tags'] || [],
'remove-tags': opt['remove-tags'] || [
'center',
'font'
],
'wrap': 120
'wrap': opt['wrap'] >= 0 ? opt['wrap'] : 120
};
if (!opt) {
return;
}
options['allow-attributes-without-values'] = opt['allow-attributes-without-values'] === true ? true : false;
options['break-around-comments'] = opt['break-around-comments'] === false ? false : true;
options['break-around-tags'] = opt['break-around-tags'] || options['break-around-tags'];
options['decode-entities'] = opt['decode-entities'] === true ? true : false;
options['indent'] = opt['indent'] || options['indent'];
options['lower-case-tags'] = opt['lower-case-tags'] === false ? false : true;
options['lower-case-attribute-names'] = opt['lower-case-attribute-names'] === false ? false : true;
options['preserve-tags'] = opt['preserve-tags'] || options['preserve-tags'];
options['remove-attributes'] = opt['remove-attributes'] || options['remove-attributes'];
options['remove-comments'] = opt['remove-comments'] === true ? true : false;
options['remove-empty-tags'] = opt['remove-empty-tags'] || options['remove-empty-tags'];
options['remove-tags'] = opt['remove-tags'] || options['remove-tags'];
options['wrap'] = opt['wrap'] >= 0 ? opt['wrap'] : options['wrap'];
if (opt['add-break-around-tags']) {

@@ -168,2 +141,6 @@ options['break-around-tags'] = options['break-around-tags'].concat(opt['add-break-around-tags']);

if (voidElements.includes(node.name)) {
return false;
}
return !node.children.length || node.children.every(isEmpty);

@@ -398,3 +375,3 @@ }

setup(opt);
setup(opt || {});

@@ -401,0 +378,0 @@ const handler = new htmlparser.DomHandler((err, dom) => {

{
"name": "clean-html",
"version": "2.0.0",
"version": "2.0.1",
"description": "HTML cleaner and beautifier",

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

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