diff options
-rw-r--r-- | lib/utils/page.js | 2 | ||||
-rw-r--r-- | test/ebook.js | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js index 8de0b24..647f557 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -122,6 +122,8 @@ function normalizeHtml(src, options) { source: isExternal? srcAbs : path.join("./", srcAbs), dest: path.join("./", dest) }); + + src = dest; } // Reset as relative to output diff --git a/test/ebook.js b/test/ebook.js index 6facd8b..9e2dab6 100644 --- a/test/ebook.js +++ b/test/ebook.js @@ -15,6 +15,7 @@ describe('eBook Generator', function () { it('should correctly convert svg images to png', function(done) { testGeneration(books[4], "ebook", function(output) { + var readmeContent = fs.readFileSync(path.join(output, "index.html"), {encoding: "utf8"}); var pageContent = fs.readFileSync(path.join(output, "sub/PAGE.html"), {encoding: "utf8"}); assert(fs.existsSync(path.join(output, "test.png"))); @@ -26,6 +27,9 @@ describe('eBook Generator', function () { assert(pageContent.indexOf('src="../test.png"') >= 0); assert(pageContent.indexOf('src="../NewTux.png"') >= 0); + + assert(readmeContent.indexOf('src="test.png"') >= 0); + assert(readmeContent.indexOf('src="NewTux.png"') >= 0); }, done); }); }); |