public function run(Article $article): self {
        $this->document($article->getDoc());

        $this->removeXPath('//comment()');
        $this->replace('em, strong, b, i, strike, del, ins', function($node) {
            return !$node->find('img')->count();
        });
        $this->replace('span[class~=dropcap], span[class~=drop_cap]');
        $this->remove('script, style');
        $this->remove('header, footer, input, form, button, aside');
        $this->removeBadTags();
        $this->remove("[id='caption'],[class='caption']");
        $this->remove("[id*=' google '],[class*=' google ']");
        $this->remove("[id*='more']:not([id^=entry-]),[class*='more']:not([class^=entry-])");
        $this->remove("[id*='facebook']:not([id*='-facebook']),[class*='facebook']:not([class*='-facebook'])");
        $this->remove("[id*='facebook-broadcasting'],[class*='facebook-broadcasting']");
        $this->remove("[id*='twitter']:not([id*='-twitter']),[class*='twitter']:not([class*='-twitter'])");
        $this->replace('span', function($node) {
            if (is_null($node->parent())) {
                return false;
            }

            return $node->parent()->is('p');
        });
        $this->convertToParagraph('div, span, article');

        return $this;
    }
public function run(Article $article): self {
        $this->document($article->getDoc());

        $this->removeXPath('//comment()');
        $this->replace('em, strong, b, i, strike, del, ins', function($node) {
            return !$node->find('img')->count();
        });
        $this->replace('span[class~=dropcap], span[class~=drop_cap]');
        $this->remove('script, style');
        $this->remove('header, footer, input, form, button, aside');
        $this->removeBadTags();
        $this->remove("[id='caption'],[class='caption']");
        $this->remove("[id*=' google '],[class*=' google ']");
        $this->remove("[id*='more']:not([id^=entry-]),[class*='more']:not([class^=entry-])");
        $this->remove("[id*='facebook']:not([id*='-facebook']),[class*='facebook']:not([class*='-facebook'])");
        $this->remove("[id*='facebook-broadcasting'],[class*='facebook-broadcasting']");
        $this->remove("[id*='twitter']:not([id*='-twitter']),[class*='twitter']:not([class*='-twitter'])");
        $this->replace('span', function($node) {
            if (is_null($node->parent())) {
                return false;
            }

            return $node->parent()->is('p');
        });
        $this->convertToParagraph('div, span, article');

        return $this;
    }
public function run ( Article $ article ) : self { $ this -> document ( $ article -> getDoc ( ) ) ; $ this -> removeXPath ( '//comment()' ) ; $ this -> replace ( 'em, strong, b, i, strike, del, ins' , function ( $ node ) { return ! $ node -> find ( 'img' ) -> count ( ) ; } ) ; $ this -> replace ( 'span[class~=dropcap], span[class~=drop_cap]' ) ; $ this -> remove ( 'script, style' ) ; $ this -> remove ( 'header, footer, input, form, button, aside' ) ; $ this -> removeBadTags ( ) ; $ this -> remove ( "[id='caption'],[class='caption']" ) ; $ this -> remove ( "[id*=' google '],[class*=' google ']" ) ; $ this -> remove ( "[id*='more']:not([id^=entry-]),[class*='more']:not([class^=entry-])" ) ; $ this -> remove ( "[id*='facebook']:not([id*='-facebook']),[class*='facebook']:not([class*='-facebook'])" ) ; $ this -> remove ( "[id*='facebook-broadcasting'],[class*='facebook-broadcasting']" ) ; $ this -> remove ( "[id*='twitter']:not([id*='-twitter']),[class*='twitter']:not([class*='-twitter'])" ) ; $ this -> replace ( 'span' , function ( $ node ) { if ( is_null ( $ node -> parent ( ) ) ) { return false ; } return $ node -> parent ( ) -> is ( 'p' ) ; } ) ; $ this -> convertToParagraph ( 'div, span, article' ) ; return $ this ; }
Clean the contents of the supplied article document

@inheritdoc
Clean the contents of the supplied article document