mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Correctly detect promises from block.process in TemplateEngine.applyBlock()
This commit is contained in:
@@ -391,7 +391,7 @@ TemplateEngine.prototype.applyBlock = function(name, blk, ctx) {
|
||||
func = this.bindContext(block.process);
|
||||
r = func.call(ctx || {}, blk);
|
||||
|
||||
if (Promise.isPromise(r)) return r.then(normBlockResult);
|
||||
if (Promise.isPromiseAlike(r)) return Promise(r).then(normBlockResult);
|
||||
else return normBlockResult(r);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user