Latte\Runtime\Filters::stripHtml PHP Method

stripHtml() public static method

Converts HTML to plain text.
public static stripHtml ( FilterInfo $info, $s ) : string
$info FilterInfo
return string plain text
    public static function stripHtml(FilterInfo $info, $s)
    {
        if (!in_array($info->contentType, [NULL, 'html', 'xhtml', 'htmlAttr', 'xhtmlAttr', 'xml', 'xmlAttr'], TRUE)) {
            trigger_error("Filter |stripHtml used with incompatible type " . strtoupper($info->contentType), E_USER_WARNING);
        }
        $info->contentType = Engine::CONTENT_TEXT;
        return html_entity_decode(strip_tags($s), ENT_QUOTES, 'UTF-8');
    }