Camp.php
/**
     * Parse the HTML text.
     * @param string html The html content to convert.
     * @param array options List of convertion 
     * @return $this
     */
Parse the HTML text.
@param string html The html content to convert.
@param array options List of convertion
@return $this
Parse the HTML text . @param string html The html content to convert . @param array options List of convertion @return $this
public function convert($html=null, $options=null){
        if($options)
            $this->setOptions($options);
        if($html)
            $this->html = $html;
        $this->amp = null;
        $this->components = array();
        if(!$this->html)
            return $this;
        $html = '<!DOCTYPE html><html><body>' . $this->html . '</body></html>';
        $this->doc = HTML5_Parser::parse($html);
        $this
            ->_convertAd()
            ->_convertFacebook()
            ->_convertIframe()
            ->_convertImg()
            ->_convertInstagram()
            ->_convertObject()
            ->_convertTwitter()
            ->_convertVideo()
            ->_cleanProhibitedAttribute()
            ->_cleanProhibitedTag();
        $amp = $this->doc->saveHTML();
        $amp = $this->_cleanHTMLClosingTag($amp);
        preg_match('!^.+<body>(.+)</body>.+$!s', $amp, $m);
        $this->amp = $m[1];
        return $this;
    }
public function convert ( $ html = null , $ options = null ) { if ( $ options ) $ this -> setOptions ( $ options ) ; if ( $ html ) $ this -> html = $ html ; $ this -> amp = null ; $ this -> components = array ( ) ; if ( ! $ this -> html ) return $ this ; $ html = '<!DOCTYPE html><html><body>' . $ this -> html . '</body></html>' ; $ this -> doc = HTML5_Parser :: parse ( $ html ) ; $ this -> _convertAd ( ) -> _convertFacebook ( ) -> _convertIframe ( ) -> _convertImg ( ) -> _convertInstagram ( ) -> _convertObject ( ) -> _convertTwitter ( ) -> _convertVideo ( ) -> _cleanProhibitedAttribute ( ) -> _cleanProhibitedTag ( ) ; $ amp = $ this -> doc -> saveHTML ( ) ; $ amp = $ this -> _cleanHTMLClosingTag ( $ amp ) ; preg_match ( '!^.+<body>(.+)</body>.+$!s' , $ amp , $ m ) ; $ this -> amp = $ m [ 1 ] ; return $ this ; }
Parse the HTML text.
Parse the HTML text .