summaryrefslogtreecommitdiffstats
path: root/lib/output/base.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-11 09:56:13 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-11 09:56:13 +0200
commitdabdeb8a807ec9c20d05246e1c1704f9762edae1 (patch)
tree4524febd5c91dc8fe834b084e8c20dbaa5244588 /lib/output/base.js
parentecd56315e60e4b90ac69fea97ad1f896ddaecf4e (diff)
downloadgitbook-dabdeb8a807ec9c20d05246e1c1704f9762edae1.zip
gitbook-dabdeb8a807ec9c20d05246e1c1704f9762edae1.tar.gz
gitbook-dabdeb8a807ec9c20d05246e1c1704f9762edae1.tar.bz2
Fix #1195: fix external images and fix test for it
Diffstat (limited to 'lib/output/base.js')
-rw-r--r--lib/output/base.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/output/base.js b/lib/output/base.js
index 903323f..a342c1e 100644
--- a/lib/output/base.js
+++ b/lib/output/base.js
@@ -207,6 +207,10 @@ Output.prototype.onOutputSVG = function(page, svg) {
// Output an image as a file
// Normalize the relative link
Output.prototype.onOutputImage = function(page, imgFile) {
+ if (location.isExternal(imgFile)) {
+ return imgFile;
+ }
+
imgFile = page.resolveLocal(imgFile);
return page.relative(imgFile);
};