diff --git a/CHANGES.md b/CHANGES.md index cdd3858..d833415 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## 0.3.0 (??-??-????) +* Fix Rhino compat. * CommonJS packaging is no longer a special case. * DRY Rakefile. * Allow whitespace around tag names. diff --git a/THANKS.md b/THANKS.md index 9843374..6dac939 100644 --- a/THANKS.md +++ b/THANKS.md @@ -17,3 +17,4 @@ Mustache.js wouldn't kick ass if it weren't for these fine souls: * dpree * Jason Smith / jhs * Aaron Gibralter / agibralter + * Ross Boucher / boucher diff --git a/mustache.js b/mustache.js index dc82698..545b0bd 100644 --- a/mustache.js +++ b/mustache.js @@ -240,7 +240,8 @@ var Mustache = function() { Does away with nasty characters */ escape: function(s) { - return ((s == null) ? "" : s).toString().replace(/&(?!\w+;)|["<>\\]/g, function(s) { + s = String(s == null ? "" : s); + return s.replace(/&(?!\w+;)|["<>\\]/g, function(s) { switch(s) { case "&": return "&"; case "\\": return "\\\\";;