ReadViewSDK/Sources/RDReaderView/EPUBTextRendering
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
..
BuildPipeline feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
Pagination feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
Typesetter feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBChapterData.swift feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
RDEPUBDTCoreTextRenderer.swift feat(reader): 实现大书快速进入与增量分页路径 2026-06-02 21:16:57 +08:00
RDEPUBTextIndexTable.swift fix: CFI module — 11 issues from code review 2026-06-18 13:25:17 +08:00
RDEPUBTextPositionConverter.swift docs: 补充注释、修正过时文档、清理重复内容 2026-06-01 09:33:23 +08:00
RDEPUBTextRenderer.swift refactor: split reader architecture and chrome handling 2026-05-31 21:47:54 +08:00
RDEPUBTextSearchEngine.swift Reorganize docs and update reader search flows 2026-06-10 08:22:07 +08:00
RDPlainTextBookBuilder.swift refactor: split reader architecture and chrome handling 2026-05-31 21:47:54 +08:00