diff --git a/src/book.js b/src/book.js index 47361b6..c36a033 100644 --- a/src/book.js +++ b/src/book.js @@ -1019,8 +1019,11 @@ EPUBJS.Book.prototype.gotoHref = function(url, defer){ split = url.split("#"); chapter = split[0]; section = split[1] || false; - // absoluteURL = (chapter.search("://") === -1) ? (this.settings.contentsPath + chapter) : chapter; - relativeURL = chapter.replace(this.settings.contentsPath, ''); + if (chapter.search("://") == -1) { + relativeURL = chapter.replace(EPUBJS.core.uri(this.settings.contentsPath).path, ''); + } else { + relativeURL = chapter.replace(this.settings.contentsPath, ''); + } spinePos = this.spineIndexByURL[relativeURL]; //-- If link fragment only stay on current chapter diff --git a/src/core.js b/src/core.js index f2b03dd..a1e6433 100644 --- a/src/core.js +++ b/src/core.js @@ -93,6 +93,9 @@ EPUBJS.core.request = function(url, type, withCredentials) { if(!type) { uri = EPUBJS.core.uri(url); type = uri.extension; + type = { + 'htm': 'html' + }[type] || type; } if(type == 'blob'){