Improve canonicalizeHTML to support empty attribute on IE8