public function testDataAtributesDash() { $html = '<body>testbody<span data-dash="dash">frml</span></body>'; $compiled = htmlparser::parse($html); $clean = htmlparser::compile($compiled); $this->assertEquals($html, $clean); }
public static function compile($page, $language = '') { $context = pobject::getContext(); $me = $context["arCurrentObject"]; include_once $me->store->get_config('code') . "modules/mod_url.php"; include_once $me->store->get_config('code') . "modules/mod_htmlparser.php"; if (!$language) { $language = $me->nls; } $page = URL::RAWtoAR($page, $language); $newpage = $page; $nodes = htmlparser::parse($newpage, array('noTagResolving' => true)); // FIXME: the isChanged check is paranoia mode on. New code ahead. // will only use the new compile method when it is needed (htmlblocks) // otherwise just return the $page, so 99.9% of the sites don't walk // into bugs. 21-05-2007 $isChanged = page::compileWorker($nodes); if ($isChanged) { return htmlparser::compile($nodes); } else { return $page; } }