summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/generate/site/index.js2
-rw-r--r--lib/parse/page.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index 5d2aee6..47d09f2 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -120,7 +120,7 @@ Generator.prototype.prepareFile = function(content, _input) {
.then(function() {
// Lex, parse includes and get
// Get HTML generated sections
- return parse.page(page.content, {
+ return parse.page(page, {
// Local files path
dir: path.dirname(_input) || '/',
diff --git a/lib/parse/page.js b/lib/parse/page.js
index 56899fd..2cbbbf4 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.includer || function() { return undefined; })))
+ page.lexed = (_.isArray(page.content) ? page.content : lex(include(page.content, options.includer || function() { return undefined; })))
+ return page.lexed
.map(function(section) {
// Transform given type
if(section.type === 'exercise') {