process() public method

*! \public Call this function to process your input
public process ( $text, $createRootNode = true )
Beispiel #1
0
 /**
  * Process html text and transform it to xml.
  *
  * @param string $text
  * @param bool $createRootNode
  * @return false|DOMDocument
  */
 public function process($text, $createRootNode = true)
 {
     $text = preg_replace('#<!--.*?-->#s', '', $text);
     // remove HTML comments
     $text = str_replace(array('&nbsp;', '&#160;', '&#xa0;'), " ", $text);
     return parent::process($text, $createRootNode);
 }
 /**
  * Process html text and transform it to xml.
  *
  * @param string $text
  * @param bool $createRootNode
  * @return false|DOMDocument
  */
 public function process($text, $createRootNode = true)
 {
     $text = preg_replace('#<!--.*?-->#s', '', $text);
     // remove HTML comments
     $text = str_replace(array(" ", '&#160;'), '&nbsp;', $text);
     // replace Unicode non breaking space with html
     return parent::process($text, $createRootNode);
 }