diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-28 10:37:52 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-28 10:37:52 +0200 |
commit | 9413e53b001c3a7ee9d07a362a7bdd69df4d4c1e (patch) | |
tree | a3f83548cb51d5ca9e601a2c5207a20367e0d82d /lib/parse/parseBook.js | |
parent | 35d352bbebee0b5adebf3f877342ff28e57a7a03 (diff) | |
download | gitbook-9413e53b001c3a7ee9d07a362a7bdd69df4d4c1e.zip gitbook-9413e53b001c3a7ee9d07a362a7bdd69df4d4c1e.tar.gz gitbook-9413e53b001c3a7ee9d07a362a7bdd69df4d4c1e.tar.bz2 |
Add tests for parseIgnore
Diffstat (limited to 'lib/parse/parseBook.js')
-rw-r--r-- | lib/parse/parseBook.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/parse/parseBook.js b/lib/parse/parseBook.js index 33f19f2..7dfa1eb 100644 --- a/lib/parse/parseBook.js +++ b/lib/parse/parseBook.js @@ -34,12 +34,16 @@ function parseMultilingualBook(book) { return Promise.reduce(langList, function(currentBook, lang) { var langID = lang.getID(); var child = Book.createFromParent(currentBook, langID); + var ignore = currentBook.getIgnore(); return Promise(child) - .then(parseIgnore) .then(parseConfig) .then(parseBookContent) .then(function(result) { + // Ignore content of this book when generating parent book + ignore.add(langID + '/**'); + currentBook = currentBook.set('ignore', ignore); + return currentBook.addLanguageBook(langID, result); }); }, book); |