summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-03-30 22:51:30 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-03-30 22:51:30 -0700
commit2c36a219380c923996ddef505567b2fc2fea32f7 (patch)
tree57e5e3d1dded11ccb5669007af8f08e9c294d2a0 /lib
parent7b4974209b8f05d89363d5431310c452dee98a70 (diff)
downloadgitbook-2c36a219380c923996ddef505567b2fc2fea32f7.zip
gitbook-2c36a219380c923996ddef505567b2fc2fea32f7.tar.gz
gitbook-2c36a219380c923996ddef505567b2fc2fea32f7.tar.bz2
Render normal sections' content to HTML
Diffstat (limited to 'lib')
-rw-r--r--lib/page.js18
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();
}