Created
October 30, 2012 00:36
Revisions
-
johan revised this gist
Oct 31, 2012 . 2 changed files with 6 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,3 @@ # 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,5 @@ // 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); }; -
johan revised this gist
Oct 30, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ window.DocumentType::toString = -> pub = " #{JSON.stringify pub}" if pub = @publicId or '' sys = " #{JSON.stringify sys}" if sys = @systemId or '' availability = '' availability = ' SYSTEM' if sys availability = ' PUBLIC' if pub declarations = " [#{declarations}]" if declarations = @internalSubset or '' "<!DOCTYPE #{@name}#{availability}#{pub}#{sys}#{declarations}>" -
johan revised this gist
Oct 30, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ window.DocumentType.prototype.toString = function() { var pub = this.publicId || '' , sys = this.systemId || '' , availability = pub ? ' PUBLIC' : sys ? ' SYSTEM' : '' , declarations = this.internalSubset || '' ; if (pub) pub = ' ' + JSON.stringify(pub); -
johan created this gist
Oct 30, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ # browser portability notes on this here: http://help.dottoro.com/ljlsvbgj.php window.DocumentType::toString = -> pub = " #{JSON.stringify pub}" if pub = @publicId or '' sys = " #{JSON.stringify sys}" if sys = @systemId or '' availability = '' availability = ' SYSTEM' if (sys) availability = ' PUBLIC' if (pub) declarations = " [#{declarations}]" if declarations = @internalSubset or '' "<!DOCTYPE #{@name}#{availability}#{pub}#{sys}#{declarations}>" 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ // browser portability notes on this here: http://help.dottoro.com/ljlsvbgj.php window.DocumentType.prototype.toString = function() { var pub = this.publicId || '' , sys = this.systemId || '' , availability = pub ? ' PUBLIC' : ' SYSTEM' : '' , declarations = this.internalSubset || '' ; if (pub) pub = ' ' + JSON.stringify(pub); if (sys) sys = ' ' + JSON.stringify(sys); if (declarations) declarations = ' [' + declarations + ']'; return '<!DOCTYPE ' + this.name + availability + pub + sys + declarations + '>'; };