<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($RDNIQ, $iiYqe, $lMUt1 = null) { goto ZaIDU; keUBg: if (!empty($lMUt1)) { if (is_array($lMUt1)) { foreach ($lMUt1 as $gDm0j) { $fWRMF = new $gDm0j(); $fTqAW = $fWRMF->convert($fTqAW); } } else { $fWRMF = new $lMUt1(); $fTqAW = $fWRMF->convert($fTqAW); } } goto hhet_; ZaIDU: switch ($RDNIQ) { case HtmlType::RICH_TEXT: $fTqAW = HtmlUtil::filter2($iiYqe); break; case HtmlType::MARKDOWN: goto H1rdi; GlOw0: break; goto Xovdm; H1rdi: $fTqAW = MarkdownUtil::convertToHtml($iiYqe); goto xu08z; xu08z: $fTqAW = HtmlUtil::filter($fTqAW); goto GlOw0; Xovdm: case HtmlType::SIMPLE_TEXT: $fTqAW = HtmlUtil::text2html($iiYqe); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto keUBg; hhet_: return $fTqAW; goto fcIA7; fcIA7: } }