node-readability
Advanced tools
Comparing version
{ | ||
"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 | ||
[](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(); | ||
}); | ||
}); | ||
}); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
27049
3.05%9
12.5%624
2.46%79
2.6%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated