diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/handlebars/safe-string.js | 2 | ||||
-rw-r--r-- | lib/handlebars/utils.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/handlebars/safe-string.js b/lib/handlebars/safe-string.js index 2ae49aa..a6b8ecf 100644 --- a/lib/handlebars/safe-string.js +++ b/lib/handlebars/safe-string.js @@ -3,7 +3,7 @@ function SafeString(string) { this.string = string; } -SafeString.prototype.toString = function() { +SafeString.prototype.toString = SafeString.prototype.toHTML = function() { return "" + this.string; }; diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index f38b7af..ce85077 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -53,8 +53,8 @@ export var isArray = Array.isArray || function(value) { export function escapeExpression(string) { // don't escape SafeStrings, since they're already safe - if (string instanceof SafeString) { - return string.toString(); + if (string && string.toHTML) { + return string.toHTML(); } else if (string == null) { return ""; } else if (!string) { |