fix(epub): decode footnote href path before spine lookup (#2271)
This commit is contained in:
+4
-4
@@ -900,10 +900,10 @@ float Epub::calculateProgress(const int currentSpineIndex, const float currentSp
|
||||
int Epub::resolveHrefToSpineIndex(const std::string& href) const {
|
||||
if (!bookMetadataCache || !bookMetadataCache->isLoaded()) return -1;
|
||||
|
||||
// Extract filename (remove #anchor)
|
||||
std::string target = href;
|
||||
size_t hashPos = target.find('#');
|
||||
if (hashPos != std::string::npos) target = target.substr(0, hashPos);
|
||||
// Split before decoding so escaped '#' characters in filenames stay part of the path.
|
||||
const size_t hashPos = href.find('#');
|
||||
const std::string rawTarget = hashPos != std::string::npos ? href.substr(0, hashPos) : href;
|
||||
const std::string target = FsHelpers::normalisePath(FsHelpers::decodeUriEscapes(rawTarget));
|
||||
|
||||
// Same-file reference (anchor-only)
|
||||
if (target.empty()) return -1;
|
||||
|
||||
Reference in New Issue
Block a user