Repository navigation
0.15.0:Word(.docx)支持与 Windows 支持 - #7
Merged
Merged
Conversation
added 15 commits
November 24, 2026 19:22
win32 path.relative returns backslashes, which broke basename/dirname, markdown image resolution, breadcrumbs and store path comparisons. Normalize at the host boundary, in the store reader, and in every client path consumer; legacy backslash paths are rewritten on read.
Decode UTF-8/UTF-16/GB18030 instead of assuming UTF-8, map ENOENT/EACCES/EBUSY to readable 404/403/423 responses, retry atomic renames and fall back to a copy, hide Windows junk files from the library, add Ctrl+Y, and test on both macOS and Windows in CI.
Handle Ctrl+wheel inside the reader instead of scaling the whole window, add Segoe UI/YaHei/Consolas to the font stacks, and reserve a stable scrollbar gutter so short documents do not shift when the scrollbar appears.
Vendor mammoth as a lazy asset, parse heading levels from style names and outlineLvl, sanitize the generated HTML, split h1 chapters, and route .docx through the existing prose, TOC, chapter navigation and guide pipeline.
Search now walks every docx chapter and jumps across chapters, and the reader_context window/position treat docx like EPUB without inventing a page.
…parts Word documents can be large or hostile; reject archives with too many parts or an oversized document.xml, and stop injecting translations into table cells where they break the column layout.
Generate a small .docx fixture for the browser run, open it after the other demos, and assert the prose, table wrapper and chapter TOC. Accept the ArrayBuffer that the host fetch returns (the previous Uint8Array-only path broke the real reader).
Run the real mammoth conversion in eval/docx.mjs, verify chapters, outline, table wrapping, TOC cleanup and the missing-part guard, then include it as the 13th release check. Stabilize the card-stacking motion probe while here.
Add browser assertions for the docx selection toolbar and a search that jumps from chapter one to chapter two, then record the 0.15 acceptance evidence and the remaining Windows-only manual checks.
Fail closed when a realpath check cannot run, use path.relative for workspace containment, sort names numerically, ignore Escape during IME composition and report clipboard failures instead of dropping them.
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.
概述
按
docs/PRD-v0.15-Word与Windows.md实现 0.15.0:reader_context;不还原分页/页眉页脚。Ctrl+Y、Ctrl+滚轮、字体/滚动条、书库垃圾文件过滤,并把测试/发布链路与 CI 扩到windows-latest。修复的 0.14 发布阻断
npm pack的 0.14.0 缺src/client/translate.js,Host 入口会ERR_MODULE_NOT_FOUND。已移到lib/block-hash.js,并让publish-check解包后 import Host 入口。验证
windows-latest/macos-latest/ubuntu-latest全绿验收记录:
docs/0.15-验收记录.md(含待真机的 Windows 清单)。发布前
v0.15.0tag(Release workflow 会 npm publish)。plugin-market.json的 0.15.0 源为 npm。