diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-28 18:27:27 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-28 18:27:27 +0100 |
commit | 1f7d349aedf6e75122b568aa3e90e016c6903f09 (patch) | |
tree | ff9295a19d9c7286a9b5cf7b504a42180178d5fa | |
parent | c0d922560daa53ad31f356480e6fbe3f2191f471 (diff) | |
download | gitbook-1f7d349aedf6e75122b568aa3e90e016c6903f09.zip gitbook-1f7d349aedf6e75122b568aa3e90e016c6903f09.tar.gz gitbook-1f7d349aedf6e75122b568aa3e90e016c6903f09.tar.bz2 |
Fix conversion of svg when cache is empty
-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); }); }); |