feat(wxread): align pagination, rendering, and docs
This commit is contained in:
@@ -17,6 +17,7 @@ final class RDEPUBTextSearchEngine: RDEPUBSearchEngine {
|
||||
|
||||
var matches: [RDEPUBSearchMatch] = []
|
||||
for chapter in textBook.chapters {
|
||||
guard let chapterData = textBook.chapterData(for: chapter.href) else { continue }
|
||||
let source = chapter.attributedContent.string as NSString
|
||||
let fullLength = source.length
|
||||
guard fullLength > 0 else {
|
||||
@@ -42,7 +43,8 @@ final class RDEPUBTextSearchEngine: RDEPUBSearchEngine {
|
||||
previewText: previewText(in: source, matchRange: foundRange),
|
||||
localMatchIndex: localMatchIndex,
|
||||
rangeLocation: foundRange.location,
|
||||
rangeLength: foundRange.length
|
||||
rangeLength: foundRange.length,
|
||||
rangeAnchor: chapterData.rangeAnchor(for: foundRange)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user