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

html-to-text

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-text - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

26

lib/html-to-text.js

@@ -11,2 +11,8 @@ var fs = require('fs');

// Which type of tags should not be parsed
var SKIP_TYPES = [
'style',
'script'
];
function htmlToText(html, options) {

@@ -21,5 +27,5 @@ options = options || {};

}, {
verbose: true,
ignoreWhitespace: true
}, {
verbose: true,
ignoreWhitespace: true
});

@@ -45,3 +51,3 @@ new htmlparser.Parser(handler).parseComplete(html);

walk(dom);
return result || dom;
return result || dom;
}

@@ -68,3 +74,3 @@

var ids = filterByPrefix(tables, '#');
return attr && (_.include(classes, attr.class) || _.include(ids, attr.id));
return attr && (_.include(classes, attr.class) || _.include(ids, attr.id));
}

@@ -77,3 +83,3 @@

case 'tag':
switch(elem.name) {
switch(elem.name.toLowerCase()) {
case 'a':

@@ -109,3 +115,3 @@ result += format.anchor(elem, walk, options);

default:
result += walk(elem.children || [], options);
result += walk(elem.children || [], options);
}

@@ -117,3 +123,5 @@ break;

default:
result += walk(elem.children || [], options);
if (!_.include(SKIP_TYPES, elem.type)) {
result += walk(elem.children || [], options);
}
}

@@ -137,2 +145,2 @@ });

return htmlToText(str, options || {});
};
};
{
"name": "html-to-text",
"version": "0.0.6",
"version": "0.0.7",
"description": "Simple html to plain text converter",

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

@@ -285,2 +285,4 @@ # node-html-to-text

TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/cc03826a7e68e1bb680cf2226276e031 "githalytics.com")](http://githalytics.com/werk85/node-html-to-text)

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