Add reference links support

This commit resolves #184
This commit is contained in:
Shaform
2014-05-27 17:21:34 +08:00
parent 89ba17de84
commit 125e804cd5
2 changed files with 6 additions and 3 deletions
+4
View File
@@ -118,6 +118,10 @@ function lexPage(src) {
return sections;
}, [])
.map(function(section) {
section.links = nodes.links;
return section;
})
.value();
}
+2 -3
View File
@@ -12,10 +12,9 @@ var lnormalize = require('../utils/lang').normalize;
// Render a section using our custom renderer
function render(section, _options) {
// Copy section
var links = section.links;
section = _.toArray(section);
// marked's Render expects this, we don't use it yet
section.links = {};
section.links = links;
// Build options using defaults and our custom renderer
var options = _.extend({}, marked.defaults, {