ReadViewSDK/Sources/RDReaderView/EPUBCore
shenlei f50495ad91 fix: CFI module — 11 issues from code review
Phase 1 (correctness):
- #1: rawValue changed from stored to computed property, eliminating stale cache risk
- #2: tokenSamples/textMarker unified to UTF-16 offsets, fixing emoji/CJK positioning
- #3: makeOffsetCFI now accepts optional contentPath parameter

Phase 2 (robustness):
- #4: Resolver uses fixed index access instead of last(where:) for manifest/spine steps
- #5: HTML comments and CDATA stripped before regex matching
- #6: Text assertion parser handles backslash escapes (\[ \] \)
- #7: Token matching uses prefix/suffix with length ratio constraints
- #8: makeOffsetRangeCFI validates startOffset <= endOffset

Phase 3 (code quality):
- #9: Shared internal nilIfEmpty extension in RDEPUBCFIUtilities.swift
- #10: RDEPUBCFIMap has markerByPath index dictionary for O(1) lookup
- #11: parseRange unified to use try (not try?) for parent parsing

Review fixes:
- Documented init(rawValue:) parameter is ignored (computed property)
- Fixed escape unescaping to handle \\ → \ correctly
- Lowered token minLength threshold from 4 to 2

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-18 13:25:17 +08:00
..
CFI fix: CFI module — 11 issues from code review 2026-06-18 13:25:17 +08:00
Models Reorganize docs and update reader search flows 2026-06-10 08:22:07 +08:00
Resources feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBAssetRepository.swift feat(epub): complete wxread parity scope 2026-05-26 09:19:37 +08:00
RDEPUBFixedLayoutTemplate.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBJavaScriptBridge.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBModels.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBNavigatorLayoutContext.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBNavigatorState.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBPaginator.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBParser.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBParser+Archive.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBParser+Package.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBParser+ReadingProfile.swift feat(reader): 实现大书快速进入与增量分页路径 2026-06-02 21:16:57 +08:00
RDEPUBParser+Resources.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBParser+TOC.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBPreferences.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBPublication.swift docs: 补充注释、修正过时文档、清理重复内容 2026-06-01 09:33:23 +08:00
RDEPUBReadingSession.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBRenderRequest.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBResourceResolver.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBResourceURLSchemeHandler.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBSearchEngine.swift docs: 补充注释、修正过时文档、清理重复内容 2026-06-01 09:33:23 +08:00
RDEPUBSearchModels.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBStyleSheetBuilder.swift feat(epub): complete wxread parity scope 2026-05-26 09:19:37 +08:00
RDEPUBTextAnchor.swift refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00
RDEPUBWebView.swift feat(epub): align wxread css and overlay pagination behavior 2026-05-25 22:15:24 +08:00
RDEPUBWebView+Configuration.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBWebView+FixedLayout.swift feat(epub): complete wxread parity scope 2026-05-26 09:19:37 +08:00
RDEPUBWebView+JavaScriptBridge.swift feat(epub): complete wxread parity scope 2026-05-26 09:19:37 +08:00
RDEPUBWebView+Reflowable.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBWebView+Search.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBWebViewDebug.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00