summaryrefslogtreecommitdiffstats
path: root/lib/parse/page.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parse/page.js')
-rw-r--r--lib/parse/page.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js
index 505d70f..937d84e 100644
--- a/lib/parse/page.js
+++ b/lib/parse/page.js
@@ -46,19 +46,22 @@ function sectionType(nodes, idx) {
}
// Render a section using our custom renderer
-function render(section) {
+function render(section, _options) {
// marked's Render expects this, we don't use it yet
section.links = {};
// Build options using defaults and our custom renderer
var options = _.extend({}, marked.defaults, {
- renderer: renderer()
+ renderer: renderer(null, _options)
});
return marked.parser(section, options);
}
-function parsePage(src) {
+function parsePage(src, options) {
+ options = options || {};
+
+ // Lex file
var nodes = marked.lexer(src);
return _.chain(splitSections(nodes))
@@ -113,7 +116,7 @@ function parsePage(src) {
return {
id: id,
type: section.type,
- content: render(section)
+ content: render(section, options)
};
})
.value();