Skip to content

Commit

Permalink
Fix {% include ignore missing %} when used with nunjucks-slim
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Jan 17, 2018
1 parent fd310f7 commit e0f1c33
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions nunjucks/src/environment.js
Expand Up @@ -238,8 +238,18 @@ var Environment = Obj.extend({
info.loader.cache[name] = tmpl;
}
} else {
tmpl = new Template('', _this,
'', eagerCompile);
tmpl = new Template({
type: 'code',
obj: {
root: function root(env, context, frame, runtime, cb) {
try {
cb(null, '');
} catch (e) {
cb(runtime.handleError(e, null, null));
}
}
}
}, _this, '', eagerCompile);
}

if (cb) {
Expand Down

0 comments on commit e0f1c33

Please sign in to comment.