Skip to content

fix(docx): 表格列宽精确满宽 9026(拉伸与压缩双分支) - #14

Merged
lqtdys merged 1 commit into
mainfrom
fix/docx-table-width
Sep 14, 2026
Merged

lqtdys merged 1 commit into
mainfrom
fix/docx-table-width

Conversation

@lqtdys

@lqtdys lqtdys commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Impact

修复 docx 表格不满宽(issue #13,用户实测 md-bundle 导出):content-based 列宽总和不足 tblW=9026 时未拉伸,Word fixed 布局按 gridCol 渲染导致表格未满宽、靠左。SKILL.md 端到端 7 表格从 5320~9079 不等 → 全部精确 9026。

  • 拉伸分支:total < 9026 等比放大 + 取整修正
  • 压缩分支:min 800 保护后精确修正循环(全列触底 break)

Verification

Risk

low — 单一函数 + 回归测试

Closes #13

@lqtdys lqtdys added the risk-low CI 绿自动合并 label Sep 14, 2026
- total < MAX_TOTAL 拉伸:等比放大 + 取整误差补首列
- total > MAX_TOTAL 压缩:min 800 保护后的精确修正循环
- 回归#13-1~5:拉伸/压缩/混合/触底保护四场景断言

fixes #13
@lqtdys
lqtdys force-pushed the fix/docx-table-width branch from b9199e0 to 72c9364 Compare September 14, 2026 15:33
@lqtdys
lqtdys merged commit 601ec51 into main Sep 14, 2026
1 check passed
lqtdys added a commit that referenced this pull request Sep 14, 2026
docx.ts 列宽修复(PR #14 / 601ec51)此前仅提交源码,web/mdpkg-web.js 与
.iife.js 构建产物未随之上库,导致下游 vendor 同步对照的上游产物过期。
本次重建产物(含 computeTableColumnWidths 拉伸/压缩双分支)。

refs #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-low CI 绿自动合并

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] docx 表格不满宽:tblGrid 列宽按内容计算,总和不足 tblW=9026

1 participant