private function filterEntities(string $string): string
    {
        return preg_replace_callback(
            '/&\w+;/',
            function ($match) {
                return str_repeat(' ', strlen($match[0]));
            },
            $string
        );
    }