OPDS Enhancements, Epub fixes, and a lot more (#4035)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
Co-authored-by: Fabian Pammer <fpammer@mantro.net>
Co-authored-by: Vinícius Licz <vinilicz@gmail.com>
This commit is contained in:
Joe Milazzo
2025-09-20 15:16:21 -05:00
committed by GitHub
parent 9891df898f
commit 26ff71f42b
339 changed files with 6923 additions and 1971 deletions
+5 -2
View File
@@ -43,11 +43,13 @@ public static partial class AnnotationHelper
var originalText = elem.InnerText;
// Calculate positions and sort by start position
var normalizedOriginalText = NormalizeWhitespace(originalText);
var sortedAnnotations = elementAnnotations
.Select(a => new
{
Annotation = a,
StartPos = originalText.IndexOf(a.SelectedText, StringComparison.Ordinal)
StartPos = normalizedOriginalText.IndexOf(NormalizeWhitespace(a.SelectedText), StringComparison.Ordinal)
})
.Where(a => a.StartPos >= 0)
.OrderBy(a => a.StartPos)
@@ -79,9 +81,10 @@ public static partial class AnnotationHelper
elem.AppendChild(HtmlNode.CreateNode(originalText.Substring(currentPos)));
}
}
catch (Exception)
catch (Exception ex)
{
/* Swallow */
return;
}
}
}