diff options
author | Kevin Decker <kpdecker@gmail.com> | 2014-11-08 17:47:25 -0600 |
---|---|---|
committer | Kevin Decker <kpdecker@gmail.com> | 2014-11-08 17:47:25 -0600 |
commit | e779ecf12dade0aba530610b37dc28a57d946c9d (patch) | |
tree | 478023b34939cc270e62519e4f3e6aeb51da7a34 /spec/utils.js | |
parent | c8af90f697c48d41e65fe84d5496e4cc0b31f74a (diff) | |
parent | 01a22e61df48eb512ba5dc0316855c1a8dd25956 (diff) | |
download | handlebars.js-e779ecf12dade0aba530610b37dc28a57d946c9d.zip handlebars.js-e779ecf12dade0aba530610b37dc28a57d946c9d.tar.gz handlebars.js-e779ecf12dade0aba530610b37dc28a57d946c9d.tar.bz2 |
Merge pull request #890 from wycats/to-html-safe
Use toHTML vs. instanceof checks for SafeString
Diffstat (limited to 'spec/utils.js')
-rw-r--r-- | spec/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/utils.js b/spec/utils.js index 0216c8d..4582e24 100644 --- a/spec/utils.js +++ b/spec/utils.js @@ -25,6 +25,12 @@ describe('utils', function() { var string = new Handlebars.SafeString('foo<&"\'>'); equals(Handlebars.Utils.escapeExpression(string), 'foo<&"\'>'); + var obj = { + toHTML: function() { + return 'foo<&"\'>'; + } + }; + equals(Handlebars.Utils.escapeExpression(obj), 'foo<&"\'>'); }); it('should handle falsy', function() { equals(Handlebars.Utils.escapeExpression(''), ''); |