summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/parse/renderer.js17
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