node-readability
Advanced tools
Comparing version 0.0.6 to 0.0.8
{ | ||
"name": "node-readability", | ||
"version": "0.0.6", | ||
"version": "0.0.8", | ||
"author": "Zihua Li", | ||
@@ -12,3 +12,3 @@ "description": "Turning any web page into a clean view.", | ||
"scripts": { | ||
"test": "./node_modules/mocha/bin/mocha" | ||
"test": "mocha -R spec" | ||
}, | ||
@@ -23,7 +23,7 @@ "main": "./src/readability", | ||
"dependencies": { | ||
"fetch": "0.2.x", | ||
"jsdom": "0.2.x" | ||
"fetch": "0.3.x", | ||
"jsdom": "0.6.x" | ||
}, | ||
"engines": [ | ||
"node >=0.5.10" | ||
"node >=0.6.0" | ||
], | ||
@@ -30,0 +30,0 @@ "keywords": [ |
@@ -5,2 +5,4 @@ # node-readability | ||
[![Build Status](https://travis-ci.org/luin/node-readability.png?branch=master)](https://travis-ci.org/luin/node-readability) | ||
## Install | ||
@@ -7,0 +9,0 @@ |
@@ -18,3 +18,3 @@ // All of the regular expressions in use within readability. | ||
exports.debug = function (debug) { | ||
dbg = (debug) ? console.log : function () {} | ||
dbg = (debug) ? console.log : function () {}; | ||
}; | ||
@@ -25,3 +25,3 @@ | ||
* This includes things like stripping javascript, CSS, and handling terrible markup. | ||
* | ||
* | ||
* @return void | ||
@@ -114,3 +114,3 @@ **/ | ||
// EXPERIMENTAL | ||
node.childNodes.forEach(function (childNode) { | ||
node.childNodes._toArray().forEach(function (childNode) { | ||
if (childNode.nodeType == 3 /*TEXT_NODE*/ ) { | ||
@@ -117,0 +117,0 @@ // use span instead of p. Need more tests. |
@@ -98,2 +98,3 @@ var jsdom = require('jsdom'); | ||
if (errors) return callback(errors); | ||
if (!window.document.body) return callback(new Error('No body tag was found.')); | ||
callback(null, new Readability(window.document, options)); | ||
@@ -100,0 +101,0 @@ } |
@@ -14,2 +14,16 @@ var readability = require('../src/readability'); | ||
}); | ||
it('should get document with frames', function (done) { | ||
readability.read('http://www.whitehouse.gov/', function(err, read) { | ||
if (err) return done(err); | ||
var dom = read.getDocument(); | ||
read.getTitle().should.equal('The White House'); | ||
done(); | ||
}); | ||
}); | ||
it('should handle the html that missing body tag', function (done) { | ||
readability.read('<html><head><title>hi</title></head>hi!</html>', function (err, read) { | ||
err.message.should.equal('No body tag was found.'); | ||
done(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27049
9
624
79
+ Addedcssom@0.3.8(transitive)
+ Addedcssstyle@0.2.37(transitive)
+ Addeddom-serializer@0.2.2(transitive)
+ Addeddomelementtype@1.3.12.3.0(transitive)
+ Addeddomhandler@2.4.2(transitive)
+ Addeddomutils@1.7.0(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addedentities@1.1.22.2.0(transitive)
+ Addedfetch@0.3.6(transitive)
+ Addedhtmlparser2@3.10.1(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjsdom@0.6.5(transitive)
+ Addednwmatcher@1.3.9(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedcssstyle@4.1.0(transitive)
- Removedfetch@0.2.9(transitive)
- Removedhtmlparser@1.7.7(transitive)
- Removediconv@3.0.1(transitive)
- Removedjsdom@0.2.19(transitive)
- Removedrrweb-cssom@0.7.1(transitive)
Updatedfetch@0.3.x
Updatedjsdom@0.6.x