/** * 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(' ', ' ', ' '), " ", $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(" ", ' '), ' ', $text); // replace Unicode non breaking space with html return parent::process($text, $createRootNode); }