diff --git a/CHANGELOG.md b/CHANGELOG.md index eb1fee387..f282a3b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,10 @@ All notable changes to this project will be documented in this file. Take a look ### Fixed +#### Shared + +* [#444](https://github.com/readium/swift-toolkit/issues/444) Fixed resolving titles of search results when the table of contents items contain fragment identifiers. + #### Navigator * Optimized scrolling to an EPUB text-based locator if it contains a CSS selector. diff --git a/Sources/Internal/Extensions/String.swift b/Sources/Internal/Extensions/String.swift index 38eca64a2..910d44c41 100644 --- a/Sources/Internal/Extensions/String.swift +++ b/Sources/Internal/Extensions/String.swift @@ -67,7 +67,7 @@ public extension String { guard let range = range(of: delimiter, options: [.backwards, .literal]) else { return self } - return String(self[...range.lowerBound]) + return String(self[..