diff --git a/Readability.js b/Readability.js index f8c12a5..821388c 100644 --- a/Readability.js +++ b/Readability.js @@ -155,7 +155,15 @@ Readability.prototype = { * @return void */ _forEachNode: function(nodeList, fn) { - return Array.prototype.forEach.call(nodeList, fn, this); + var i = 0; + while (nodeList[i]) { + var el = nodeList[i]; + fn.call(this, el, i, nodeList); + // Only increment i if the element is still in the list: + if (nodeList[i] == el) { + i++ + } + } }, /**