diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-07-11 17:20:43 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-07-11 17:20:43 -0700 |
commit | 1b87cec893806928a9f26bfe5e04102645dad0e5 (patch) | |
tree | fc4734079da09e7db0e7a02cdb5992f5b2280b82 /lib/parse | |
parent | 4a894b1e18510ff7d40cdbc244952424ad6bb545 (diff) | |
parent | 6bbefad24e6aa4a5b51b4b21bdf30b73f8cb4d41 (diff) | |
download | gitbook-1b87cec893806928a9f26bfe5e04102645dad0e5.zip gitbook-1b87cec893806928a9f26bfe5e04102645dad0e5.tar.gz gitbook-1b87cec893806928a9f26bfe5e04102645dad0e5.tar.bz2 |
Merge pull request #266 from shaform/ref_links
Add reference links support
Diffstat (limited to 'lib/parse')
-rw-r--r-- | lib/parse/lex.js | 4 | ||||
-rw-r--r-- | lib/parse/page.js | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/parse/lex.js b/lib/parse/lex.js index 17eab69..852d4e0 100644 --- a/lib/parse/lex.js +++ b/lib/parse/lex.js @@ -118,6 +118,10 @@ function lexPage(src) { return sections; }, []) + .map(function(section) { + section.links = nodes.links; + return section; + }) .value(); } diff --git a/lib/parse/page.js b/lib/parse/page.js index d714a15..b459798 100644 --- a/lib/parse/page.js +++ b/lib/parse/page.js @@ -13,10 +13,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, { |