Fix comparison

This commit is contained in:
jpirnay
2026-02-27 11:09:42 +01:00
parent 9a4c9baf85
commit 5e62dd79cd
+2 -1
View File
@@ -129,7 +129,8 @@ struct ParserState {
bool found = false;
for (const auto& anchor : anchors) {
const std::string anchorPath = ignoreIndices ? removeIndices(anchor.xpath) : anchor.xpath;
const std::string normalizedAnchor = normalizeXPath(anchor.xpath);
const std::string anchorPath = ignoreIndices ? removeIndices(normalizedAnchor) : normalizedAnchor;
if (anchorPath == probe) {
const int depth = pathDepth(anchorPath);
if (!found || depth > bestDepth || (depth == bestDepth && anchor.textOffset < bestOffset)) {