From 3cbad7730f074a0831448e44608834681df6cefd Mon Sep 17 00:00:00 2001 From: bill-titus Date: Fri, 24 Mar 2017 19:25:08 -0400 Subject: [PATCH] Remove poison CFI fix for double spineIndex It turns out that spineNodeIndex is set here: this.spineNodeIndex = Array.prototype.indexOf.call(spineNode.parentNode.childNodes, spineNode); And childNodes includes the list of all nodes (text and elements) already. --- src/epubcfi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epubcfi.js b/src/epubcfi.js index dd4a924..318f3ff 100644 --- a/src/epubcfi.js +++ b/src/epubcfi.js @@ -948,7 +948,7 @@ class EpubCFI { generateChapterComponent(_spineNodeIndex, _pos, id) { var pos = parseInt(_pos), - spineNodeIndex = (_spineNodeIndex + 1) * 2, + spineNodeIndex = _spineNodeIndex + 1, cfi = "/"+spineNodeIndex+"/"; cfi += (pos + 1) * 2;