You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the DOM element is serialized, if the serialized string contains " ", the Image throws an onerror event. (that is swallowed)
I suppose this is more of a Safari bug.
However, the issue can be avoided by doing the following:
// serialize the DOM node to a String
var serialized = new XMLSerializer().serializeToString(elem);
serialized.replace(/ /gi, '');
or perhaps another more efficient solution. In my specific use case I don't care if the non-breaking-space ends up breaking, but I can see where this might be an issue for others
EDIT: The above code didn't work, had to do this...
// collect all nodes within the element, copy the current style to the clone
Array.prototype.forEach.call(children, function(child, i) {
copyCSS(child, origChildren[i]);
child.innerHTML = child.innerHTML.replace(/ /gi, '');
});
The text was updated successfully, but these errors were encountered:
When the DOM element is serialized, if the serialized string contains " ", the Image throws an onerror event. (that is swallowed)
I suppose this is more of a Safari bug.
However, the issue can be avoided by doing the following:
or perhaps another more efficient solution. In my specific use case I don't care if the non-breaking-space ends up breaking, but I can see where this might be an issue for others
EDIT: The above code didn't work, had to do this...
The text was updated successfully, but these errors were encountered: