Skip to content

Commit

Permalink
Minor cchange in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah authored and gijsk committed Apr 3, 2020
1 parent 3976fa3 commit 668a3a1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,12 +1376,8 @@ Readability.prototype = {
}

// If noscript has previous sibling and it only contains image,
// replace it with noscript content. However, in some case there
// is possibility that img inside noscript has lower quality
// than the one in previous sibling, so we will keep the src
// and srcset attribute from old img as data attribute for
// img from noscript. We also keep old attributes that might
// contains image.
// replace it with noscript content. However we also keep old
// attributes that might contains image.
var prevElement = noscript.previousElementSibling;
if (prevElement && this._isSingleImage(prevElement)) {
var prevImg = prevElement;
Expand All @@ -1403,14 +1399,14 @@ Readability.prototype = {

var attrName = attr.name;
if (newImg.hasAttribute(attrName)) {
attrName = "data-old-" + attrName;
attrName = "data-old-" + attrName;
}

newImg.setAttribute(attrName, attr.value);
}
}

noscript.parentNode.replaceChild(tmp.children[0], prevElement);
noscript.parentNode.replaceChild(tmp.firstElementChild, prevElement);
}
});
},
Expand Down

0 comments on commit 668a3a1

Please sign in to comment.