diff options
author | Andres Rey <[email protected]> | 2016-12-15 13:35:01 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2016-12-15 13:35:01 +0000 |
commit | 0ea923c85532ed6ff25c582f7281b958c2f0daa4 (patch) | |
tree | 3b3084bbdc341d6bb626ede744b807f5821c39e1 /src/HTMLParser.php | |
parent | 4c8d547cdadf871f09bc8c855bfdab98e3ce434b (diff) |
Moved the position of the backupnode creation since we need it without the script tags.
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r-- | src/HTMLParser.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 9cc67a2..e005f5b 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -128,6 +128,9 @@ class HTMLParser $this->removeScripts(); + // In case we need the original HTML to create a fake top candidate + $this->backupdom = clone $this->dom; + $this->metadata = $this->getMetadata(); $this->title = $this->getTitle(); @@ -190,9 +193,6 @@ class HTMLParser // Prepend the XML tag to avoid having issues with special characters. Should be harmless. $this->dom->loadHTML('<?xml encoding="UTF-8">' . $html); $this->dom->encoding = 'UTF-8'; - - // In case we need the original HTML to create a fake top candidate - $this->backupdom = clone $this->dom; } /** |