diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-20 17:32:32 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-20 17:32:32 +0100 |
commit | 847c6b9aa2a84f1a7508341a6e64230c8a3daa1a (patch) | |
tree | 3ea3597f10b3355836afcd25ba7d747a63800d0e | |
parent | cafbcd409774c383a26ce22b82b2104774c54c6d (diff) | |
download | gitbook-847c6b9aa2a84f1a7508341a6e64230c8a3daa1a.zip gitbook-847c6b9aa2a84f1a7508341a6e64230c8a3daa1a.tar.gz gitbook-847c6b9aa2a84f1a7508341a6e64230c8a3daa1a.tar.bz2 |
Fix error in blocks detection with nunjucks
-rw-r--r-- | lib/template/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index 215ebcd..a2d00b5 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -199,7 +199,7 @@ TemplateEngine.prototype.addBlock = function(name, block) { lastBlockArgs = parser.parseSignature(null, true); parser.advanceAfterBlockEnd(lastBlockName); } - } while (lastBlockName == block.end) + } while (lastBlockName != block.end) parser.advanceAfterBlockEnd(); @@ -343,6 +343,7 @@ TemplateEngine.prototype.render = function(content, context, options) { options = _.defaults(options || {}, { path: null }); + var filename = options.path; // Setup path and type if (options.path) { @@ -355,7 +356,7 @@ TemplateEngine.prototype.render = function(content, context, options) { return Promise.nfcall(this.env.renderString.bind(this.env), content, context, options) .fail(function(err) { throw error.TemplateError(err, { - filename: options.path + filename: filename || '<inline>' }); }); }; |