Skip to content

Commit

Permalink
Make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah authored and gijsk committed Apr 3, 2020
1 parent c8eab07 commit e85122e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,14 @@ Readability.prototype = {
* @param Element
**/
_isSingleImage: function(node) {
if (node.tagName === "IMG") return true;
if (node.children.length !== 1) return false;
if (node.textContent.trim() !== "") return false;
if (node.tagName === "IMG") {
return true;
}

if (node.children.length !== 1 || node.textContent.trim() !== "") {
return false;
}

return this._isSingleImage(node.children[0]);
},

Expand Down Expand Up @@ -1358,7 +1363,9 @@ Readability.prototype = {
// Parse content of noscript and make sure it only contains image
var tmp = doc.createElement("div");
tmp.innerHTML = noscript.innerHTML;
if (!this._isSingleImage(tmp)) return;
if (!this._isSingleImage(tmp)) {
return;
}

// If noscript has previous sibling and it only contains image,
// replace it with noscript content. However, in some case there
Expand Down

0 comments on commit e85122e

Please sign in to comment.