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

node-readability

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-readability - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

2

package.json
{
"name": "node-readability",
"version": "0.0.8",
"version": "0.0.9",
"author": "Zihua Li",

@@ -5,0 +5,0 @@ "description": "Turning any web page into a clean view.",

@@ -195,2 +195,4 @@ // All of the regular expressions in use within readability.

if (topCandidate === null || topCandidate.tagName === "BODY") {
// With no top candidate, bail out if no body tag exists as last resort.
if (!document.body) return new Error("No body tag was found.");
topCandidate = document.createElement("DIV");

@@ -197,0 +199,0 @@ topCandidate.innerHTML = document.body.innerHTML;

@@ -1,2 +0,5 @@

var readability = require('../src/readability');
var readability = require('../src/readability')
, helpers = require('../src/helpers')
, jsdom = require( 'jsdom' )
, noBody = '<html><head><title>hi</title></head>hi!</html>';
require('should');

@@ -23,3 +26,3 @@

it('should handle the html that missing body tag', function (done) {
readability.read('<html><head><title>hi</title></head>hi!</html>', function (err, read) {
readability.read(noBody, function (err, read) {
err.message.should.equal('No body tag was found.');

@@ -29,2 +32,9 @@ done();

});
it('should let helpers.grabArticle handle html that\'s missing a body tag', function (done) {
jsdom.env(noBody, [], function (errors, window) {
var err = helpers.grabArticle(window.document);
err.message.should.equal('No body tag was found.');
done();
});
});
});
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