Skip to content

Commit

Permalink
bypass undefined and null escapes
Browse files Browse the repository at this point in the history
Fixes #60
  • Loading branch information
nolimits4web committed Jun 14, 2019
1 parent cafab6d commit 142819c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Template7Helpers = {
return p.compiled(ctx, options.data, options.root);
},
escape(context) {
if (typeof context === 'undefined' || context === null) return '';
if (typeof context !== 'string') {
throw new Error('Template7: Passed context to "escape" helper should be a string');
}
Expand Down

0 comments on commit 142819c

Please sign in to comment.