<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Html; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Markdown\MarkdownUtil; class HtmlConverter { public static function convertToHtml($umNjG, $Ral1i, $lA6Qi = null) { goto aYpFJ; P61Oj: return $FpbVq; goto Xwou8; aYpFJ: switch ($umNjG) { case HtmlType::RICH_TEXT: $FpbVq = HtmlUtil::filter($Ral1i); break; case HtmlType::MARKDOWN: goto hgWGy; TQMbT: $FpbVq = HtmlUtil::filter($FpbVq); goto nXwEz; nXwEz: break; goto alKy3; hgWGy: $FpbVq = MarkdownUtil::convertToHtml($Ral1i); goto TQMbT; alKy3: case HtmlType::SIMPLE_TEXT: $FpbVq = HtmlUtil::text2html($Ral1i); break; default: throw new \Exception('HtmlConverter.convertToHtml contentType error'); } goto EPVsk; EPVsk: if (!empty($lA6Qi)) { if (is_array($lA6Qi)) { foreach ($lA6Qi as $yWVpo) { $JyCdb = new $yWVpo(); $FpbVq = $JyCdb->convert($FpbVq); } } else { $JyCdb = new $lA6Qi(); $FpbVq = $JyCdb->convert($FpbVq); } } goto P61Oj; Xwou8: } }