Merge pull request #74 from Kdecherf/fix/pre-filters-failure

pull/101/head 1.2.10
Jérémy Benoist 4 years ago committed by GitHub
commit 5638357306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/Readability.php

@ -137,10 +137,6 @@ class Readability implements LoggerAwareInterface
protected $useTidy;
// raw HTML filters
protected $pre_filters = [
// remove obvious scripts
'!<script[^>]*>(.*?)</script>!is' => '',
// remove obvious styles
'!<style[^>]*>(.*?)</style>!is' => '',
// remove spans as we redefine styles and they're probably special-styled
'!</?span[^>]*>!is' => '',
// HACK: firewall-filtered content
@ -397,6 +393,9 @@ class Readability implements LoggerAwareInterface
$this->logger->debug($this->lightClean ? 'Light clean enabled.' : 'Standard clean enabled.');
$this->clean($articleContent, 'style');
$this->clean($articleContent, 'script');
$this->cleanStyles($articleContent);
$this->killBreaks($articleContent);

Loading…
Cancel
Save