File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments