Created
October 30, 2012 00:36
-
-
Save johan/3977584 to your computer and use it in GitHub Desktop.
A more useful DocumentType.prototype.toString implementation than present-day browsers provide.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 @ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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