<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($ucXCG, $ZA40Q, $CA39P = null) { goto w0nAU; w0nAU: switch ($ucXCG) { case HtmlType::RICH_TEXT: $eiHAU = HtmlUtil::filter($ZA40Q); break; case HtmlType::MARKDOWN: goto rNWsL; rNWsL: $eiHAU = MarkdownUtil::convertToHtml($ZA40Q); goto IsJqS; y2BQL: break; goto py2Ut; IsJqS: $eiHAU = HtmlUtil::filter($eiHAU); goto y2BQL; py2Ut: case HtmlType::SIMPLE_TEXT: $eiHAU = HtmlUtil::text2html($ZA40Q); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto ngTxg; ngTxg: if (!empty($CA39P)) { if (is_array($CA39P)) { foreach ($CA39P as $hMlii) { $rsYfe = new $hMlii(); $eiHAU = $rsYfe->convert($eiHAU); } } else { $rsYfe = new $CA39P(); $eiHAU = $rsYfe->convert($eiHAU); } } goto nUf_q; nUf_q: return $eiHAU; goto ZtBbc; ZtBbc: } }