From 8a69caf1dd9c7226cca7fe587c8d1b9e9b5d8c47 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:27:51 +0800 Subject: [PATCH] Fix CFI for fixed-layout books --- view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view.js b/view.js index a36fac7..a85d07c 100644 --- a/view.js +++ b/view.js @@ -163,8 +163,8 @@ export class View { this.emit?.({ type: 'show-annotation', value, range }) } getCFI(index, range) { - if (!range) return '' const baseCFI = this.book.sections[index].cfi ?? CFI.fake.fromIndex(index) + if (!range) return baseCFI return CFI.joinIndir(baseCFI, CFI.fromRange(range)) } resolveCFI(cfi) {