summaryrefslogtreecommitdiffstats
path: root/lib/parse/renderer.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-09 08:23:11 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-09 08:23:11 +0200
commit99594791e0c34aee3659370b8c2072df815c9051 (patch)
tree5a523d3cbd3aec55a9bbf97beda7bff7605e9b62 /lib/parse/renderer.js
parent1b432288f041baef2ebe54c96a7a86f547b14c67 (diff)
parent2cc23b7e3411e1748bc8a25114a7bf9185a210f1 (diff)
downloadgitbook-99594791e0c34aee3659370b8c2072df815c9051.zip
gitbook-99594791e0c34aee3659370b8c2072df815c9051.tar.gz
gitbook-99594791e0c34aee3659370b8c2072df815c9051.tar.bz2
Merge Optional github
Diffstat (limited to 'lib/parse/renderer.js')
-rw-r--r--lib/parse/renderer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js
index 848f6e3..86576f0 100644
--- a/lib/parse/renderer.js
+++ b/lib/parse/renderer.js
@@ -45,7 +45,7 @@ GitBookRenderer.prototype.link = function(href, title, text) {
var o = this._extra_options;
// Relative link, rewrite it to point to github repo
- if(!parsed.protocol && parsed.path[0] != '/' && o && o.repo && o.dir) {
+ if(!parsed.protocol && parsed.path && parsed.path[0] != '/' && o && o.repo && o.dir) {
href = 'https://github.com/' + o.repo + '/blob' + path.normalize(path.join(
'/',
o.dir,
@@ -79,7 +79,7 @@ GitBookRenderer.prototype.image = function(href, title, text) {
var o = this._extra_options;
// Relative image, rewrite it depending output
- if(!parsed.protocol && parsed.path[0] != '/' && o && o.dir && o.outdir) {
+ if(!parsed.protocol && parsed.path && parsed.path[0] != '/' && o && o.dir && o.outdir) {
_href = path.relative(o.outdir, path.normalize(path.join(
o.dir,
href