public static function strip($text = '', array $allowedTags = []): string
    {
        $text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5);
        foreach ($allowedTags as $tag) {
            $text = \preg_replace('|<(/?'.$tag.'\ ?/?)>|i', '{{{{\\1}}}}', $text);
            $text = \preg_replace('|<('.$tag.' [^>]+)>|i', '{{{{\\1}}}}', $text);
        }
        $text = \preg_replace('/<[^>]+>/', ' ', $text);
        foreach ($allowedTags as $tag) {
            $text = \preg_replace('|{{{{(/?'.$tag.'\ ?/?)}}}}|i', '<\\1>', $text);
            $text = \preg_replace('|{{{{('.$tag.' [^}]+)}}}}|i', '<\\1>', $text);
        }
        $text = \preg_replace('/\s+/', ' ', $text);

        return \trim($text);
    }