Skip to content
Browse files

Use escape even when autoescape=false

  • Loading branch information...
1 parent bdd15de commit 7c9b78e2cd36dace38792f0a899ee4331b33401e @Almad Almad committed Sep 7, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/helpers.js
View
9 lib/helpers.js
@@ -258,8 +258,10 @@ exports.wrapFilter = function (variable, filter) {
return output;
};
-exports.wrapFilters = function (variable, filters, context, escape) {
+exports.wrapFilters = function (variable, filters, context, defaultEscape) {
var output = exports.escapeVarName(variable, context);
+ var escape;
+
if (filters && filters.length > 0) {
_.each(filters, function (filter) {
@@ -269,7 +271,7 @@ exports.wrapFilters = function (variable, filters, context, escape) {
return;
case 'e':
case 'escape':
- escape = filter.args || escape;
+ escape = filter.args || true;
return;
default:
output = exports.wrapFilter(output, filter, '_filters');
@@ -279,8 +281,9 @@ exports.wrapFilters = function (variable, filters, context, escape) {
}
output = output || '""';
+ if (escape === undefined) escape = defaultEscape;
if (escape) {
- output = '_filters.escape.call(this, ' + output + ', ' + escape + ')';
+ output = '_filters.escape.call(this, ' + output + ', ' + defaultEscape + ')';
}
return output;

0 comments on commit 7c9b78e

Please sign in to comment.
Something went wrong with that request. Please try again.