Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A more useful DocumentType.prototype.toString implementation than present-day browsers provide.
# With thanks to Stewart Brodie for the reminder: http://goo.gl/IHa4p
# (See old version of this gist for a more roundabout hack I came up with)
window.DocumentType::toString = -> (new XMLSerializer).serializeToString @
// With thanks to Stewart Brodie for the reminder: http://goo.gl/IHa4p
// (See old version of this gist for a more roundabout hack I came up with)
window.DocumentType.prototype.toString = function() {
return (new XMLSerializer).serializeToString(this);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.