summaryrefslogtreecommitdiff
path: root/src/Readability.php
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2016-11-14 16:45:12 +0000
committerAndres Rey <[email protected]>2016-11-14 16:45:12 +0000
commit1c176922209b8a3002434a670b64a6f3683f812f (patch)
treede472bdf516c8ebae33c9f07e86e7c8128e659d5 /src/Readability.php
parent4ff745766c127ecfa013c8344fd1c1e2f4a2dc5d (diff)
Replacing old node when setting a new node tag
Diffstat (limited to 'src/Readability.php')
-rw-r--r--src/Readability.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 0ad22e4..7fc0d2b 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -287,6 +287,8 @@ class Readability extends Element implements ReadabilityInterface
// The import must be done on the firstChild of $new, since $new is a DOMDocument and not a DOMElement.
$import = $this->node->ownerDocument->importNode($new->firstChild, true);
$this->node->parentNode->replaceChild($import, $this->node);
+
+ $this->node = $import;
}
/**