summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-02-13 08:09:28 +0100
committerSamy Pessé <samypesse@gmail.com>2015-02-13 08:09:28 +0100
commitb0fd2a67ea586e59f4c8370acc9c093e44d7f3bd (patch)
treea790813b647c8ae93324232e5a1105d7cde7e891 /lib/template.js
parent7c8386986919f611dcdaaf917bf0c24fabcfe3a4 (diff)
downloadgitbook-b0fd2a67ea586e59f4c8370acc9c093e44d7f3bd.zip
gitbook-b0fd2a67ea586e59f4c8370acc9c093e44d7f3bd.tar.gz
gitbook-b0fd2a67ea586e59f4c8370acc9c093e44d7f3bd.tar.bz2
Fix test with post in blocks
Diffstat (limited to 'lib/template.js')
-rw-r--r--lib/template.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/template.js b/lib/template.js
index 08e1877..0565824 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -93,7 +93,7 @@ TemplateEngine.prototype.processBlock = function(blk) {
});
blk.id = _.uniqueId("blk");
- var toAdd = blk.parse || (blk.post != undefined);
+ var toAdd = (!blk.parse) || (blk.post != undefined);
// Add to global map
if (toAdd) this.blocks[blk.id] = blk;
@@ -368,7 +368,7 @@ TemplateEngine.prototype.postProcess = function(content) {
return Q(content)
.then(that.replaceBlocks)
- .then(function(content) {
+ .then(function(_content) {
return batch.execEach(that.blocks, {
max: 20,
fn: function(blk, blkId) {
@@ -382,7 +382,7 @@ TemplateEngine.prototype.postProcess = function(content) {
});
}
})
- .thenResolve(content);
+ .thenResolve(_content);
});
};