diff options
author | codepiano <codepiano.li@gmail.com> | 2014-10-31 18:00:09 +0800 |
---|---|---|
committer | codepiano <codepiano.li@gmail.com> | 2014-10-31 18:00:09 +0800 |
commit | 9da10e2b25cb8ad919bb8563cfdc81d9e0612341 (patch) | |
tree | 841729e1147b5863c1e34da861ff280816496b90 /lib/parse | |
parent | 1e4632080b64c7f100c3886454fedab70c7d8909 (diff) | |
download | gitbook-9da10e2b25cb8ad919bb8563cfdc81d9e0612341.zip gitbook-9da10e2b25cb8ad919bb8563cfdc81d9e0612341.tar.gz gitbook-9da10e2b25cb8ad919bb8563cfdc81d9e0612341.tar.bz2 |
bugfix,init page object's lexed attribute.
the page object's attribute 'lexed' is not correctly inited.so when
use page.lexed to generate the search index file,nothing will be
indexed.
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/page.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js index e694f1c..e4d9c46 100644 --- a/lib/parse/page.js +++ b/lib/parse/page.js @@ -47,11 +47,12 @@ function quizQuestion(node) { } } -function parsePage(src, options) { +function parsePage(page, options) { options = options || {}; // Lex if not already lexed - return (_.isArray(src) ? src : lex(include(src, [options.dir, options.includes_dir], options.variables))) + page.lexed = (_.isArray(page.content) ? page.content : lex(include(page.content, [options.dir, options.includes_dir], options.variables))) + return page.lexed .map(function(section) { // Transform given type if(section.type === 'exercise') { |