mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
Merge pull request #323 from bit/patches
fix loading .htm files and relative links if epub.js is not at /
This commit is contained in:
commit
0884a0aa8c
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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'){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue