DOC-101 实现文件类型识别 #6
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
实现 detect_material_type。
使用 infer + mime_guess。识别顺序:magic bytes -> MIME -> 扩展名。
需要识别:.md .txt .pdf .png .jpg .jpeg .webp .gif .epub .doc .docx .xls .xlsx .ppt .pptx unknown
验收标准:fixtures 中每种格式至少有一个样例、能正确返回 MaterialType、未知文件返回 Unknown 不 panic、有单元测试
完成项
✅ detect_material_type(file_path) 已实现
✅ 识别策略:magic bytes → MIME → 扩展名
✅ MaterialType::preview_mode() 映射方法
依赖
识别覆盖
测试
待跟进
⬜ 后续可增加真实文件 fixture 测试(当前仅扩展名级别测试)
⬜ DOC-102 Markdown 解析
M1 里程碑审查通过 — 2026-05-30
审查结果:✅ 全部通过
数据
需改进项(不阻塞)
⚠️ 缺少 JPEG/WebP/GIF fixture
⚠️ 缺少复杂 Markdown fixture
⚠️ 搜索未测中文/Unicode 边界
下一步
进入 M2:iOS Binding 与 Demo 接入,从 DOC-201 UniFFI Swift Binding 开始。
审查人:Claude
日期:2026-05-30