node-readability
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "node-readability", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Zihua Li", | ||
@@ -5,0 +5,0 @@ "description": "Turning any web page into a clean view.", |
@@ -5,3 +5,3 @@ # Readability | ||
[![Build Status](https://travis-ci.org/luin/node-readability.png?branch=master)](https://travis-ci.org/luin/node-readability) | ||
[![Build Status](https://travis-ci.org/luin/readability.png?branch=master)](https://travis-ci.org/luin/readability) | ||
@@ -8,0 +8,0 @@ ## Features |
@@ -5,4 +5,4 @@ var jsdom = require('jsdom'); | ||
var encodinglib = require("encoding"); | ||
var urllib = require('url'); | ||
exports.debug = function(debug) { | ||
@@ -45,6 +45,8 @@ helpers.debug(debug); | ||
Readability.prototype.close = function() { | ||
this._window && this._window.close(); | ||
if (this._window) { | ||
this._window.close(); | ||
} | ||
this._window = null; | ||
this._document = null; | ||
} | ||
}; | ||
@@ -171,3 +173,6 @@ Readability.prototype.getContent = function(notDeprecated) { | ||
if (html.indexOf('<') === -1) { | ||
var parsedURL = urllib.parse(html); | ||
if (['http:', 'https:', 'unix:', 'ftp:', 'sftp:'].indexOf(parsedURL.protocol) === -1) { | ||
jsdomParse(null, null, html); | ||
} else { | ||
request(html, options, function(err, res, buffer) { | ||
@@ -201,4 +206,2 @@ if (err) { | ||
}); | ||
} else { | ||
jsdomParse(null, null, html); | ||
} | ||
@@ -205,0 +208,0 @@ |
3731122
21
2431