diff --git a/src/contents.js b/src/contents.js index 6eba0b0..b061422 100644 --- a/src/contents.js +++ b/src/contents.js @@ -406,10 +406,8 @@ class Contents { } } - } else if(typeof target === "string" && - target.indexOf("#") > -1) { - - let id = target.substring(target.indexOf("#")+1); + } else if(typeof target === "string") { + let id = target; let el = this.document.getElementById(id); if(el) { diff --git a/src/rendition.js b/src/rendition.js index 2e51a71..0214a81 100644 --- a/src/rendition.js +++ b/src/rendition.js @@ -243,7 +243,7 @@ class Rendition { // removing the chapter if(!isCfiString && typeof target === "string" && target.indexOf("#") > -1) { - moveTo = target; + moveTo = target.substring(target.indexOf("#")+1); } if (isCfiString) {