Go to file
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
.claude/skills Epub阅读器0.0.1 2026-05-21 19:40:51 +08:00
.xcodebuildmcp feat(wxread): align pagination, rendering, and docs 2026-05-24 15:36:01 +08:00
Doc feat: 实现大书远距目录跳转与后台补全优化方案 2026-06-15 16:28:11 +08:00
ReadViewDemo feat: 设置面板与章节运行时联动优化 2026-06-17 09:47:50 +08:00
scripts feat: EPUB 阅读器搜索、选中注释、书签 chrome 状态及大量重构优化 2026-06-13 22:48:56 +08:00
Sources/RDReaderView fix: CFI module — 11 issues from code review 2026-06-18 13:25:17 +08:00
.gitignore chore: add .artifacts/ to .gitignore 2026-06-15 08:38:09 +08:00
AGENTS.md feat(wxread): align pagination, rendering, and docs 2026-05-24 15:36:01 +08:00
CONTEXT.md Reorganize docs and update reader search flows 2026-06-10 08:22:07 +08:00
Podfile chore: checkpoint current milestone work 2026-05-22 13:28:53 +08:00
RDReaderView.podspec refactor: 添加中文注释 + 优化模块结构 2026-05-25 10:19:14 +08:00