diff --git a/Readability.js b/Readability.js index 3ef723c..6e61f12 100644 --- a/Readability.js +++ b/Readability.js @@ -338,12 +338,12 @@ Readability.prototype = { // if the link only contains simple text content, it can be converted to a text node if (link.childNodes.length === 1 && link.childNodes[0].nodeType === this.TEXT_NODE) { var text = this._doc.createTextNode(link.textContent); - link.parentNode.replaceChild(text, link); + link.parentNode.replaceChild(text, link); } else { // if the link has multiple children, they should all be preserved - var container = this._doc.createElement('span') + var container = this._doc.createElement("span"); while (link.childNodes.length > 0) { - container.appendChild(link.childNodes[0]) + container.appendChild(link.childNodes[0]); } link.parentNode.replaceChild(container, link); }