mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
Update Id generation to use full URL instead of just the filename
This commit is contained in:
parent
dc23a53f62
commit
de1861ba86
1 changed files with 2 additions and 2 deletions
|
@ -161,7 +161,7 @@ class Publication {
|
||||||
}
|
}
|
||||||
item.url = resolve(this.url, item.url || item.href);
|
item.url = resolve(this.url, item.url || item.href);
|
||||||
// TEMP hack for handling EpubCFI
|
// TEMP hack for handling EpubCFI
|
||||||
const id = encodeURIComponent(filename(item.url).split(".")[0]);
|
const id = "id_" + encodeURIComponent(item.url).replaceAll("%", "--");
|
||||||
item.id = id;
|
item.id = id;
|
||||||
// Index 2 for Sections
|
// Index 2 for Sections
|
||||||
item.cfiBase = item.cfiBase || `2/${index * 2}[${id}]`
|
item.cfiBase = item.cfiBase || `2/${index * 2}[${id}]`
|
||||||
|
@ -219,7 +219,7 @@ class Publication {
|
||||||
}
|
}
|
||||||
item.url = this.resolve(item.url || item.href);
|
item.url = this.resolve(item.url || item.href);
|
||||||
// TEMP hack for handling EpubCFI
|
// TEMP hack for handling EpubCFI
|
||||||
const id = encodeURIComponent(filename(item.url).split(".")[0]);
|
const id = "id_" + encodeURIComponent(item.url).replaceAll("%", "--");
|
||||||
item.id = id;
|
item.id = id;
|
||||||
// Index 4 for Resources
|
// Index 4 for Resources
|
||||||
item.cfiBase = item.cfiBase || `4/${index * 2}[${id}]`
|
item.cfiBase = item.cfiBase || `4/${index * 2}[${id}]`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue