diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-21 17:23:07 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-21 17:23:07 +0100 |
commit | a9c96c1afa8c9322645d25684d4171ba540a4d8f (patch) | |
tree | 06be18198e015291fa2ba29f69db843889ea21b6 /lib/output/assets-inliner.js | |
parent | a446deaff32714c81fb02c7138de48fafa8216c8 (diff) | |
download | gitbook-a9c96c1afa8c9322645d25684d4171ba540a4d8f.zip gitbook-a9c96c1afa8c9322645d25684d4171ba540a4d8f.tar.gz gitbook-a9c96c1afa8c9322645d25684d4171ba540a4d8f.tar.bz2 |
Fix resolve of relatives images in assets inliner
Diffstat (limited to 'lib/output/assets-inliner.js')
-rw-r--r-- | lib/output/assets-inliner.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/output/assets-inliner.js b/lib/output/assets-inliner.js index 6768830..6f1f02d 100644 --- a/lib/output/assets-inliner.js +++ b/lib/output/assets-inliner.js @@ -63,12 +63,16 @@ module.exports = function assetsInliner(Base) { }) .then(function() { + // Resolve src to a relative filepath to the book's root + src = page.resolveLocal(src); + + // Already a PNG/JPG/.. ? if (path.extname(src).toLowerCase() != '.svg') { return src; } // Convert SVG to PNG - return that.convertSVGFile(that.resolveOutputForPage(page, src)); + return that.convertSVGFile(that.resolve(src)); }) // Return relative path from the page |