src/Extractor/ContentExtractor.php
private function getReadability($html, $url, $parser, $enableTidy)
    {
        $readability = new Readability($html, $url, $parser, $enableTidy);

        if (isset($this->config['readability']['pre_filters']) && \is_array($this->config['readability']['pre_filters'])) {
            foreach ($this->config['readability']['pre_filters'] as $filter => $replacer) {
                $readability->addPreFilter($filter, $replacer);
            }
        }

        if (isset($this->config['readability']['post_filters']) && \is_array($this->config['readability']['post_filters'])) {
            foreach ($this->config['readability']['post_filters'] as $filter => $replacer) {
                $readability->addPostFilter($filter, $replacer);
            }
        }

        return $readability;
    }
private function getReadability($html, $url, $parser, $enableTidy)
    {
        $readability = new Readability($html, $url, $parser, $enableTidy);

        if (isset($this->config['readability']['pre_filters']) && \is_array($this->config['readability']['pre_filters'])) {
            foreach ($this->config['readability']['pre_filters'] as $filter => $replacer) {
                $readability->addPreFilter($filter, $replacer);
            }
        }

        if (isset($this->config['readability']['post_filters']) && \is_array($this->config['readability']['post_filters'])) {
            foreach ($this->config['readability']['post_filters'] as $filter => $replacer) {
                $readability->addPostFilter($filter, $replacer);
            }
        }

        return $readability;
    }
private function getReadability ( $ html , $ url , $ parser , $ enableTidy ) { $ readability = new Readability ( $ html , $ url , $ parser , $ enableTidy ) ; if ( isset ( $ this -> config [ 'readability' ] [ 'pre_filters' ] ) && \ is_array ( $ this -> config [ 'readability' ] [ 'pre_filters' ] ) ) { foreach ( $ this -> config [ 'readability' ] [ 'pre_filters' ] as $ filter => $ replacer ) { $ readability -> addPreFilter ( $ filter , $ replacer ) ; } } if ( isset ( $ this -> config [ 'readability' ] [ 'post_filters' ] ) && \ is_array ( $ this -> config [ 'readability' ] [ 'post_filters' ] ) ) { foreach ( $ this -> config [ 'readability' ] [ 'post_filters' ] as $ filter => $ replacer ) { $ readability -> addPostFilter ( $ filter , $ replacer ) ; } } return $ readability ; }
Return an instance of Readability with pre & post filters added.

@param string $html       HTML to make readable from Readability lib
@param string $url        URL of the content
@param string $parser     Parser to use
@param bool   $enableTidy Should it use tidy extension?

@return Readability
Return an instance of Readability with pre & post filters added .