Skip to content

Commit 32afb79

Browse files
committed
Fix ID assertion in section base CFI
XML ID assertions should contain the `id` attribute of the element itself. Fixes #1236
1 parent 228d991 commit 32afb79

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/packaging.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class Packaging {
167167
// var manifestPropArray = manifestProps.length ? manifestProps.split(" ") : [];
168168

169169
var itemref = {
170+
"id" : item.getAttribute("id"),
170171
"idref" : idref,
171172
"linear" : item.getAttribute("linear") || "yes",
172173
"properties" : propArray,

src/spine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Spine {
5151
var spineItem;
5252

5353
item.index = index;
54-
item.cfiBase = this.epubcfi.generateChapterComponent(this.spineNodeIndex, item.index, item.idref);
54+
item.cfiBase = this.epubcfi.generateChapterComponent(this.spineNodeIndex, item.index, item.id);
5555

5656
if (item.href) {
5757
item.url = resolver(item.href, true);

0 commit comments

Comments
 (0)