diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output/assets-inliner.js | 6 | ||||
-rw-r--r-- | lib/output/folder.js | 10 |
2 files changed, 5 insertions, 11 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 diff --git a/lib/output/folder.js b/lib/output/folder.js index 4d8584e..f5b7063 100644 --- a/lib/output/folder.js +++ b/lib/output/folder.js @@ -73,16 +73,6 @@ module.exports = function folderOutput(Base) { return pathUtil.resolveInRoot.apply(null, [this.root()].concat(_.toArray(arguments))); }; - // Resolve a file path from a page (in the output folder) - // Result is an absolute path (enforced in outptu folder) - FolderOutput.prototype.resolveOutputForPage = function(page, filename) { - if (_.isString(page)) page = this.book.getPage(page); - - var abs = page.resolveLocal(filename); - return this.resolve(abs); - }; - - // Copy a file to the output FolderOutput.prototype.copyFile = function(from, to) { var that = this; |