<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($fqA26, $fKViA, $rCsPt = null) { goto n1OYZ; n1OYZ: switch ($fqA26) { case HtmlType::RICH_TEXT: $ehntX = HtmlUtil::filter($fKViA); break; case HtmlType::MARKDOWN: goto oKOQv; oKOQv: $ehntX = MarkdownUtil::convertToHtml($fKViA); goto ScZpK; woXmI: break; goto dWpic; ScZpK: $ehntX = HtmlUtil::filter($ehntX); goto woXmI; dWpic: case HtmlType::SIMPLE_TEXT: $ehntX = HtmlUtil::text2html($fKViA); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto lmbEo; m_mqO: return $ehntX; goto ifuaE; lmbEo: if (!empty($rCsPt)) { if (is_array($rCsPt)) { foreach ($rCsPt as $VD0JV) { $Z1ri9 = new $VD0JV(); $ehntX = $Z1ri9->convert($ehntX); } } else { $Z1ri9 = new $rCsPt(); $ehntX = $Z1ri9->convert($ehntX); } } goto m_mqO; ifuaE: } }