diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 846f8d323b..13fed66f11 100644 Binary files a/resources/compiled_coffeescript.zip and b/resources/compiled_coffeescript.zip differ diff --git a/src/calibre/ebooks/oeb/display/indexing.coffee b/src/calibre/ebooks/oeb/display/indexing.coffee index ecc6e6f03a..3bd8b95766 100644 --- a/src/calibre/ebooks/oeb/display/indexing.coffee +++ b/src/calibre/ebooks/oeb/display/indexing.coffee @@ -106,7 +106,8 @@ class BookIndexing links = [] anchors = {} in_paged_mode = window.paged_display?.in_paged_mode - for a in document.querySelectorAll("body a[href], body [id], body a[name]") + + for a in document.querySelectorAll("body, body a[href], body [id], body a[name]") if in_paged_mode geom = window.paged_display.column_location(a) else @@ -118,11 +119,11 @@ class BookIndexing if href links.push([href, geom]) id = a.getAttribute("id") - if id and id not in anchors + if id and not anchors[id] anchors[id] = geom if a.tagName in ['A', "a"] name = a.getAttribute("name") - if name and name not in anchors + if name and not anchors[name] anchors[name] = geom return {'links':links, 'anchors':anchors}