diff options
-rw-r--r-- | lib/output/base.js | 4 | ||||
-rw-r--r-- | test/page.js | 2 |
2 files changed, 5 insertions, 1 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); }; diff --git a/test/page.js b/test/page.js index f961653..0fc59e7 100644 --- a/test/page.js +++ b/test/page.js @@ -289,7 +289,7 @@ describe('Page', function() { it('should keep external images path', function() { page.content.should.be.html({ - 'img[src="https:/upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"]': { + 'img[src="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"]': { count: 1 } }); |