summaryrefslogtreecommitdiffstats
path: root/lib/parse
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-11-03 16:57:35 +0100
committerSamy Pessé <samypesse@gmail.com>2014-11-03 16:57:35 +0100
commit40c4035afb3d59d3c0b11f9ce6abf2fdf6fe4de1 (patch)
tree85f745e4b5c1affc6bee42c7e789e4398faa1968 /lib/parse
parent0feb672d708e2d73ee159d5a94b614f90c85e9e2 (diff)
downloadgitbook-40c4035afb3d59d3c0b11f9ce6abf2fdf6fe4de1.zip
gitbook-40c4035afb3d59d3c0b11f9ce6abf2fdf6fe4de1.tar.gz
gitbook-40c4035afb3d59d3c0b11f9ce6abf2fdf6fe4de1.tar.bz2
Fix #491: handle correctly url without path for links
Diffstat (limited to 'lib/parse')
-rw-r--r--lib/parse/renderer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js
index 0f6640b..5b6a79d 100644
--- a/lib/parse/renderer.js
+++ b/lib/parse/renderer.js
@@ -49,7 +49,7 @@ GitBookRenderer.prototype.link = function(href, title, text) {
// Parsed version of the url
var parsed = url.parse(href);
var o = this._extra_options;
- var extname = _.last(parsed.path.split("."));
+ var extname = parsed.path? _.last(parsed.path.split(".")) : "";
// Relative link, rewrite it to point to github repo
if(links.isRelative(_href) && extname == "md") {