diff --git a/base.php b/base.php index a1b7e7c..575eefc 100644 --- a/base.php +++ b/base.php @@ -68,13 +68,14 @@ function are_libxml_errors_ok () function html2xhtml ($html) { $doc = new DOMDocument(); libxml_use_internal_errors(true); - $doc->loadHTML('' . - $html . ''); // Load the HTML - $output = $doc->saveXML($doc->documentElement); // Transform to an Ansi xml stream - $output = xml2xhtml($output); - if (preg_match ('#(.*)#ms', $output, $matches)) { - $output = $matches [1]; // Remove - } + + $doc->loadHTML('' . + $html . ''); // Load the HTML + $output = $doc->saveXML($doc->documentElement); // Transform to an Ansi xml stream + $output = xml2xhtml($output); + if (preg_match ('#(.*)#ms', $output, $matches)) { + $output = $matches [1]; // Remove + } /* // In case of error with summary, use it to debug $errors = libxml_get_errors();