diff options
author | Andrew Dolgov <[email protected]> | 2024-06-13 15:22:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2024-06-13 15:22:47 +0300 |
commit | 6fa51adb5e663fe01d7d01f75f8029393f3fbc2e (patch) | |
tree | 1ee62ec76f7cd0879b03dd55150f067d8f19bbd9 /vendor/fivefilters/readability.php/src/Readability.php | |
parent | 4dd70d93d60fbc20d127a8259ac568df4bdd8564 (diff) | |
parent | f2169ca419be339fa5ba32d0a50770f3d442d8b7 (diff) |
Diffstat (limited to 'vendor/fivefilters/readability.php/src/Readability.php')
-rw-r--r-- | vendor/fivefilters/readability.php/src/Readability.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/fivefilters/readability.php/src/Readability.php b/vendor/fivefilters/readability.php/src/Readability.php index 6407a92..c5318a4 100644 --- a/vendor/fivefilters/readability.php/src/Readability.php +++ b/vendor/fivefilters/readability.php/src/Readability.php @@ -342,7 +342,7 @@ class Readability // Extract JSON-LD metadata before removing scripts $this->jsonld = $this->configuration->getDisableJSONLD() ? [] : $this->getJSONLD($dom); - $this->removeScripts($dom); + $this->removeIgnoredElements($dom); $this->prepDocument($dom); @@ -1188,13 +1188,13 @@ class Readability } /** - * Removes all the scripts of the html. + * Removes elements that should be ignored. * * @param DOMDocument $dom */ - private function removeScripts(DOMDocument $dom) + private function removeIgnoredElements(DOMDocument $dom) { - foreach (['script', 'noscript'] as $tag) { + foreach (['noscript', 'script', ...$this->configuration->getExtraIgnoredElements()] as $tag) { $nodes = $dom->getElementsByTagName($tag); foreach (iterator_to_array($nodes) as $node) { NodeUtility::removeNode($node); |