Skip to content

Commit 5638357

Browse files
authored
Merge pull request #74 from Kdecherf/fix/pre-filters-failure
2 parents b1a20a9 + 651e8a6 commit 5638357

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Readability.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ class Readability implements LoggerAwareInterface
137137
protected $useTidy;
138138
// raw HTML filters
139139
protected $pre_filters = [
140-
// remove obvious scripts
141-
'!<script[^>]*>(.*?)</script>!is' => '',
142-
// remove obvious styles
143-
'!<style[^>]*>(.*?)</style>!is' => '',
144140
// remove spans as we redefine styles and they're probably special-styled
145141
'!</?span[^>]*>!is' => '',
146142
// HACK: firewall-filtered content
@@ -397,6 +393,9 @@ public function prepArticle(\DOMNode $articleContent)
397393

398394
$this->logger->debug($this->lightClean ? 'Light clean enabled.' : 'Standard clean enabled.');
399395

396+
$this->clean($articleContent, 'style');
397+
$this->clean($articleContent, 'script');
398+
400399
$this->cleanStyles($articleContent);
401400
$this->killBreaks($articleContent);
402401

0 commit comments

Comments
 (0)