Fix #287: convert getElementsByTagName result to an array (#288)

pull/289/head
Gijs 8 years ago
parent c3c91a739b
commit 69b81f5d70

@ -193,7 +193,8 @@ Readability.prototype = {
return node.querySelectorAll(tagNames.join(','));
}
return [].concat.apply([], tagNames.map(function(tag) {
return node.getElementsByTagName(tag);
var collection = node.getElementsByTagName(tag);
return Array.isArray(collection) ? collection : Array.from(collection);
}));
},

Loading…
Cancel
Save