feat(wxread): align pagination, rendering, and docs

This commit is contained in:
shen
2026-05-24 15:36:01 +08:00
parent a318c0e3d0
commit 2a94921e88
103 changed files with 6124 additions and 4623 deletions
@@ -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)
)
)