diff options
-rw-r--r-- | lib/page.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/page.js b/lib/page.js index 1929f6b..7288fb9 100644 --- a/lib/page.js +++ b/lib/page.js @@ -34,9 +34,27 @@ function parsePage(src) { return _.chain(splitSections(nodes)) .map(function(section) { + // Detect section type section.type = sectionType(section); return section; }) + .map(function(section) { + // Transform given type + if(section.type === 'exercise') { + return { + type: section.type, + }; + } + + // marked's Render expects this, we don't use it yet + section.links = {}; + + // Render normal pages + return { + type: section.type, + content: marked.parser(section) + }; + }) .value(); } |