diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-30 22:51:30 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-30 22:51:30 -0700 |
commit | 2c36a219380c923996ddef505567b2fc2fea32f7 (patch) | |
tree | 57e5e3d1dded11ccb5669007af8f08e9c294d2a0 | |
parent | 7b4974209b8f05d89363d5431310c452dee98a70 (diff) | |
download | gitbook-2c36a219380c923996ddef505567b2fc2fea32f7.zip gitbook-2c36a219380c923996ddef505567b2fc2fea32f7.tar.gz gitbook-2c36a219380c923996ddef505567b2fc2fea32f7.tar.bz2 |
Render normal sections' content to HTML
-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(); } |