<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($gFnmy, $eTwx_, $NdyWa = null) { goto UgKXN; l_Sr3: if (!empty($NdyWa)) { if (is_array($NdyWa)) { foreach ($NdyWa as $rt5lL) { $vNjqq = new $rt5lL(); $yPdr6 = $vNjqq->convert($yPdr6); } } else { $vNjqq = new $NdyWa(); $yPdr6 = $vNjqq->convert($yPdr6); } } goto RP3bH; UgKXN: switch ($gFnmy) { case HtmlType::RICH_TEXT: $yPdr6 = HtmlUtil::filter($eTwx_); break; case HtmlType::MARKDOWN: goto Ve452; JaMLN: $yPdr6 = HtmlUtil::filter($yPdr6); goto oi0eB; Ve452: $yPdr6 = MarkdownUtil::convertToHtml($eTwx_); goto JaMLN; oi0eB: break; goto JPxwA; JPxwA: case HtmlType::SIMPLE_TEXT: $yPdr6 = HtmlUtil::text2html($eTwx_); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto l_Sr3; RP3bH: return $yPdr6; goto WIQMZ; WIQMZ: } }