示例#1
0
 public static function tidyHTML($html, $useDOM = false)
 {
     if (!$html) {
         return $html;
     }
     if (!$useDOM) {
         if (!self::$_htmlFixer) {
             self::$_htmlFixer = new BBM_Helper_HtmlFixer();
         }
         $htmlFixer = self::$_htmlFixer;
         return $htmlFixer->getFixedHtml($html);
     }
     $doc = new DOMDocument();
     libxml_use_internal_errors(true);
     $readyContent = self::_beforeLoadHtml($html);
     $doc->loadHTML('<?xml encoding="utf-8"?>' . $readyContent);
     libxml_clear_errors();
     $doc->encoding = 'utf-8';
     $doc->formatOutput = true;
     $doc->removeChild($doc->firstChild);
     //remove html tag
     $doc->removeChild($doc->firstChild);
     //remove xml fix
     $doc->replaceChild($doc->firstChild->firstChild->firstChild, $doc->firstChild);
     //make wip tag content as first child
     $html = $doc->saveHTML($doc->documentElement);
     $html = self::_afterSaveHtml($html);
     return $html;
 }
示例#2
0
 public static function AioInstalled()
 {
     return BBM_Helper_BbCodes::installedAddon('Tinhte_AIO');
 }