1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-02 14:49:16 +02:00

Fix ID assertion in section base CFI

XML ID assertions should contain the `id` attribute of the element itself.

Fixes #1236
This commit is contained in:
John Factotum 2021-12-27 14:52:07 +08:00
parent 228d9913e0
commit 32afb79fd1
2 changed files with 2 additions and 1 deletions

View file

@ -167,6 +167,7 @@ class Packaging {
// var manifestPropArray = manifestProps.length ? manifestProps.split(" ") : [];
var itemref = {
"id" : item.getAttribute("id"),
"idref" : idref,
"linear" : item.getAttribute("linear") || "yes",
"properties" : propArray,

View file

@ -51,7 +51,7 @@ class Spine {
var spineItem;
item.index = index;
item.cfiBase = this.epubcfi.generateChapterComponent(this.spineNodeIndex, item.index, item.idref);
item.cfiBase = this.epubcfi.generateChapterComponent(this.spineNodeIndex, item.index, item.id);
if (item.href) {
item.url = resolver(item.href, true);