summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-29 00:12:28 +0000
committerAndres Rey <[email protected]>2017-11-29 00:12:28 +0000
commit3a2259ad3bc4495725b9b0f6fe3b6b82c5193203 (patch)
tree1f124238839b6ed73b3e5f205eb025b9f8d333bf /src
parentdbc05528180d54a3cf36d728283daef47b841c59 (diff)
Fix child replacing call
Diffstat (limited to 'src')
-rw-r--r--src/Readability.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php
index e80c07b..61174b1 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -485,7 +485,7 @@ class Readability
/** @var $child DOMNode */
if ($child->nodeType === XML_TEXT_NODE && mb_strlen(trim(NodeUtility::getTextContent($child))) > 0) {
$newNode = $node->createNode($child, 'p');
- $child->replaceChild($newNode, $child);
+ $child->parentNode->replaceChild($newNode, $child);
}
}
}