getDomDocument(); $rightDocument = (new XmlDocument($right, $loading))->getDomDocument(); $error = ""; XmlSystems::diffNode( $leftDocument, $rightDocument, $error, $excludedAttributes ); return $error; } /** * @param $text * @return int the number of lines estimated */ public static function countLines($text) { return count(preg_split("/<\/p>|<\/h[1-9]{1}>||<\/li>|
|<\/pre>/", $text)) - 1; } /** * @throws ExceptionBadSyntax */ public static function normalize($htmlText) { if (empty($htmlText)) { throw new \RuntimeException("The text should not be empty"); } $xmlDoc = new XmlDocument($htmlText, XmlDocument::HTML_TYPE); return $xmlDoc->toXmlNormalized(); } }