Fix #1195: fix external images and fix test for it

This commit is contained in:
Samy Pessé
2016-04-11 09:56:13 +02:00
parent ecd56315e6
commit dabdeb8a80
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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);
};
+1 -1
View File
@@ -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
}
});