From af0050aba7ffe9d6d275aa722e7271a7449ecdbf Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Wed, 26 Oct 2022 06:07:15 +0000 Subject: [PATCH] MOBI: fix duplicated anchors --- mobi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobi.js b/mobi.js index 5126d61..3b72840 100644 --- a/mobi.js +++ b/mobi.js @@ -725,9 +725,9 @@ class MOBI6 { // which will be used to insert anchor elements // because only then can they be referenced in the DOM this.#fileposList = [...new Set(fileposInNCX - .concat(Array.from(str.matchAll(fileposRegex), m => m[1])) + .concat(Array.from(str.matchAll(fileposRegex), m => m[1])))] .map(filepos => ({ filepos, number: Number(filepos) })) - .sort((a, b) => a.number - b.number))] + .sort((a, b) => a.number - b.number) this.metadata = this.mobi.getMetadata() this.getCover = this.mobi.getCover.bind(this.mobi)