From bc84d139af1cdbcc38184444d27739478157bc74 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Mar 2021 11:26:37 +0530 Subject: [PATCH] Content server viewer: Fix highlights not sorted correctly in the highlights panel. Fixes #1918436 [Highlights in viewer are not sorted correctly](https://bugs.launchpad.net/calibre/+bug/1918436) --- src/pyj/read_book/annotations.pyj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/annotations.pyj b/src/pyj/read_book/annotations.pyj index 15e49acdfb..cb7718d55e 100644 --- a/src/pyj/read_book/annotations.pyj +++ b/src/pyj/read_book/annotations.pyj @@ -18,7 +18,8 @@ def bookmark_get_cfi(b): def highlight_get_cfi(hl): cfi = hl.start_cfi if cfi: - return cfi[8:-1] + si = hl.spine_index or 9999999999 + return f'/{si}/{cfi}' def sort_annot_list(annots, get_cfi_func):