protected function fix(\DOMNode $node, $value)
    {
        $fixed = $value;
        if ($node instanceof \DOMText) {
            $fixed = str_replace("\n", '', $fixed);
            $fixed = preg_replace('/\s+/u', ' ', $fixed);
            $fixed = str_replace('<', '&lt;', $fixed);
            $fixed = str_replace('>', '&gt;', $fixed);
        }

        return $fixed;
    }