diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-10-13 10:53:51 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-10-13 10:53:51 +0200 |
commit | 26fad5b8888d0cc5ce271abe568ac45640dea96b (patch) | |
tree | 35b8b75a62c4f61370a89c41654a740c4d3131db /lib/parse/renderer.js | |
parent | f049576575ccb71d50064a92882de4cf23e1c52f (diff) | |
download | gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.zip gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.tar.gz gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.tar.bz2 |
Remove ref to github options
Diffstat (limited to 'lib/parse/renderer.js')
-rw-r--r-- | lib/parse/renderer.js | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js index e6854f2..faa416c 100644 --- a/lib/parse/renderer.js +++ b/lib/parse/renderer.js @@ -56,20 +56,9 @@ GitBookRenderer.prototype.link = function(href, title, text) { var o = this._extra_options; // Relative link, rewrite it to point to github repo - if(links.isRelative(_href)) { - if (path.extname(parsed.path) == ".md") { - _href = links.toAbsolute(_href, o.dir || "./", o.outdir || "./"); - - if (o.singleFile) { - _href = "#"+_href; - } else { - _href = _href.replace(".md", ".html"); - } - } else if (o && o.repo && o.dir) { - href = url.resolve('https://github.com/' + o.repo + '/blob/', [o.dir, _href].join("/")); - parsed = url.parse(href); - _href = parsed.href; - } + if(links.isRelative(_href) && path.extname(parsed.path) == ".md") { + _href = links.toAbsolute(_href, o.dir || "./", o.outdir || "./"); + _href = _href.replace(".md", ".html"); } // Generate HTML for link |