diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-29 14:09:27 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-29 14:09:27 +0100 |
commit | 2bec7c5e10274b260faea3e007b056c19760cc6e (patch) | |
tree | 7c16616115430b151093e634afe3e66b8341ffe1 /lib/book.js | |
parent | 907ce6dbcdbebd59f4ce5a43073b0dd68056d6c2 (diff) | |
download | gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.zip gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.gz gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.bz2 |
Add option to block to not parse output
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/book.js b/lib/book.js index 24ab505..5099291 100644 --- a/lib/book.js +++ b/lib/book.js @@ -524,9 +524,22 @@ Book.prototype.parsePage = function(filename, options) { return filetype.parser.page(page.content); }) + // Post process sections + .then(function(_page) { + return _.reduce(_page.sections, function(prev, section) { + return prev.then(function(_sections) { + return that.template.postProcess(section.content || "") + .then(function(content) { + section.content = content; + return _sections.concat([section]); + }) + }); + }, Q([])); + }) + // Prepare html - .then(function(_page) { - return pageUtil.normalize(_page.sections, { + .then(function(_sections) { + return pageUtil.normalize(_sections, { book: that, convertImages: options.convertImages, input: filename, |