Runs an HTML string through the links, mentions, emoji and spoilers formatters.
protected static processHTML ( $html ) : string | ||
$html | An unparsed HTML string. | |
return | string | The formatted HTML string. |
/** * Format text from WYSIWYG editor input. * * @param $Mixed * @return mixed|string */ public static function wysiwyg($Mixed) { static $CustomFormatter; if (!isset($CustomFormatter)) { $CustomFormatter = c('Garden.Format.WysiwygFunction', false); } if (!is_string($Mixed)) { return self::to($Mixed, 'Wysiwyg'); } elseif (is_callable($CustomFormatter)) { return $CustomFormatter($Mixed); } else { // The text contains html and must be purified. $Formatter = Gdn::factory('HtmlFormatter'); if (is_null($Formatter)) { // If there is no HtmlFormatter then make sure that script injections won't work. return self::display($Mixed); } // HTML filter first $Mixed = $Formatter->format($Mixed); // Links $Mixed = Gdn_Format::processHTML($Mixed); return $Mixed; } }