<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($zy_dP, $OfwYj, $Kg8Pr = null) { goto UrW7l; UrW7l: switch ($zy_dP) { case HtmlType::RICH_TEXT: $nprfh = HtmlUtil::filter($OfwYj); break; case HtmlType::MARKDOWN: goto U3WXj; Py2Qz: $nprfh = HtmlUtil::filter($nprfh); goto f2CBi; U3WXj: $nprfh = MarkdownUtil::convertToHtml($OfwYj); goto Py2Qz; f2CBi: break; goto Yj3sG; Yj3sG: case HtmlType::SIMPLE_TEXT: $nprfh = HtmlUtil::text2html($OfwYj); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto SokaV; SokaV: if (!empty($Kg8Pr)) { if (is_array($Kg8Pr)) { foreach ($Kg8Pr as $BkECU) { $DJCYc = new $BkECU(); $nprfh = $DJCYc->convert($nprfh); } } else { $DJCYc = new $Kg8Pr(); $nprfh = $DJCYc->convert($nprfh); } } goto Fjd0f; Fjd0f: return $nprfh; goto vDAuv; vDAuv: } }