diff options
author | wn_ <[email protected]> | 2024-04-03 17:42:59 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2024-04-03 17:42:59 +0000 |
commit | 9ba1adcde4953c8e04630b7b31c29b66d158d428 (patch) | |
tree | 05d540d97ad9d1b3bdb65ddbe26c1410658b1b28 /vendor/fivefilters/readability.php/src/Readability.php | |
parent | 684721a181377915e42c7a04c1a099be12eb4a38 (diff) |
Update 'fivefilters/readability.php' to 37c0c2ce76aa90e8adafbd5cb0b0332a54df1523
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); |