private function filterMetaTags(string $string): string
    {
        return preg_replace_callback(
            '/<meta[^>]+(http-equiv\s*=|name\s*=\s*["\']?([^>"\']+))[^>]*>/i',
            function ($match) {
                if (count($match) < 3
                    || !in_array(strtolower($match[2]), self::$textMetaTags, true)
                ) {
                    return str_repeat(' ', strlen($match[0]));
                }

                return $match[0];
            },
            $string
        );
    }