From c401fa7ab4e407a9b23ca203cc4209478cdf5817 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sun, 8 Oct 2023 23:22:33 +0800 Subject: [PATCH] CFI: wrap fake CFI --- epubcfi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epubcfi.js b/epubcfi.js index 4c0200c..cd16d2b 100644 --- a/epubcfi.js +++ b/epubcfi.js @@ -327,7 +327,7 @@ export const toElement = (doc, parts) => // turn indices into standard CFIs when you don't have an actual package document export const fake = { - fromIndex: index => `/6/${(index + 1) * 2}`, + fromIndex: index => wrap(`/6/${(index + 1) * 2}`), toIndex: parts => parts?.at(-1).index / 2 - 1, }