From 913c24407b521a8c29cdb1bc15125f61c7e1c07d Mon Sep 17 00:00:00 2001 From: jpirnay Date: Thu, 19 Mar 2026 16:43:34 +0100 Subject: [PATCH] case fix --- lib/KOReaderSync/ChapterXPathIndexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/KOReaderSync/ChapterXPathIndexer.cpp b/lib/KOReaderSync/ChapterXPathIndexer.cpp index 4a6dbc35..a9e27a49 100644 --- a/lib/KOReaderSync/ChapterXPathIndexer.cpp +++ b/lib/KOReaderSync/ChapterXPathIndexer.cpp @@ -45,7 +45,7 @@ struct ParserState { std::vector> siblingCounters; std::vector anchors; - std::string baseXPath() const { return "/body/DocFragment[" + std::to_string(spineIndex + 1) + "]/body"; } + std::string baseXPath() const { return "/body/docfragment[" + std::to_string(spineIndex + 1) + "]/body"; } // Canonicalize incoming KOReader XPath before matching: // - remove all whitespace @@ -135,7 +135,7 @@ struct ParserState { const std::string& anchorPath = ignoreIndices ? anchor.xpathNoIndex : anchor.xpath; if (anchorPath == probe) { const int depth = pathDepth(anchorPath); - if (!found || depth > bestDepth || (depth == bestDepth && anchor.textOffset < bestOffset)) { + if (!found || depth > bestDepth || (depth == bestDepth && anchor.textOffset > bestOffset)) { found = true; bestDepth = depth; bestOffset = anchor.textOffset;