Repository navigation
fix: 支持 Windows Word/PPT 导入与转换 - #8
Merged
Peter-cuhk merged 2 commits intoSep 18, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows 上的 LibreOffice 查找原先使用冒号拆分 PATH,且不能正确识别反斜杠路径,导致已安装的转换器或自定义路径无法被发现。转换超时还会在进程关闭前开始清理输入文件和用户配置。本次改动补齐 Windows 查找与后台执行,并在转换退出后清理文件,让 DOC/DOCX/PPT/PPTX 能通过本机 LibreOffice 导入为 PDF。
关联 #5,属于 Windows 适配计划的阶段 C。
改动
soffice.com,兼容soffice.exe。显式配置优先,拼错路径不静默换用其他安装。验证
环境:Windows 11 x64、Node.js 24.17.0、LibreOffice 26.8.0.3;真实 LibreOffice 从官方 MSI 展开到含中文和空格的自定义目录。
npm run test:office:25/25 通过,无需安装 LibreOffice 或登录 AI。npm run test:office-smoke:真实 DOCX、PPTX、DOC、PPT 均转换成功,PDF.js 检查各两页的英文标记和中文字层。soffice.exe转换,以及真实soffice.com超时后退出和临时文件清理。npm test:149 项中 147 通过,2 失败。未经修改的main为 127 项中 125 通过、同样 2 失败:Windows 下的 Unix shebang 模拟 Codex,以及缺失的个人paper-reader/SKILL.md。这两项由 fix: 支持 Windows 本机 Codex 发现与调用 #7 另行处理。提交前分支 CI 在提交
6278d02上的 Windows/macOS × Node 22/24 四组均通过,覆盖启动测试、Office 模拟测试、构建、启动冒烟、类型检查和 lint;该工作流不等同于完整npm test,上述两项既有失败单独记录。真实 LibreOffice 转换只在 Windows 上验收;旧 PPT 与 PPTX 的第一页文字对齐存在差异,未宣称排版无损,也未覆盖加密文件、宏及复杂嵌入对象。
与 #7 的衔接
基于当前
main的7c112af。共享进程清理模块、启动器引用和对应夹具调整与 #7 完全一致,可以分别评审;本 PR 的 Office 转换不依赖 #7 中尚未合入的 Codex 接入逻辑。若 #7 先合入,会同步 main 并整理 README 与 CI 中的重叠修改。