diff --git a/src/calibre/ebooks/oeb/display/cfi.coffee b/src/calibre/ebooks/oeb/display/cfi.coffee index edcc0ad0df..86594854a4 100644 --- a/src/calibre/ebooks/oeb/display/cfi.coffee +++ b/src/calibre/ebooks/oeb/display/cfi.coffee @@ -260,7 +260,7 @@ class CanonicalFragmentIdentifier index |= 1 # Increment index by 1 if it is even if child.nodeType == 1 index++ - if ( index == target ) + if index == target cfi = cfi.substr(r[0].length) node = child if assertion and node.id != assertion diff --git a/src/calibre/ebooks/oeb/display/test-cfi/index.html b/src/calibre/ebooks/oeb/display/test-cfi/index.html index e5d8eea491..03adb57d2b 100644 --- a/src/calibre/ebooks/oeb/display/test-cfi/index.html +++ b/src/calibre/ebooks/oeb/display/test-cfi/index.html @@ -31,6 +31,7 @@ max-height: 100px; overflow: scroll; border: solid 1px black; + padding: 2em; } @@ -39,6 +40,7 @@
Scroll down and click on some elements. Make sure to hit both bold and not bold text
Entities: & © § >
+An invisible CDATA: followed by some text