Repository navigation
表格未设列宽时读态被钉成窄列修复 - #330
Merged
todosdev[bot] merged 1 commit intoNov 30, 2026
Merged
表格未设列宽时读态被钉成窄列修复#330
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.
Summary
min-width: 25px里内嵌的width: 25px误读成列宽。width:声明,min-width/max-width不再被读成列宽;<col width>属性与百分比列宽行为不变。Changes
列宽解析(
web/src/lib/table-columns.ts)readColgroupWidths的 style 正则由/width\s*:\s*…/i改为/(?:^|;)\s*width\s*:\s*…/i,只认行首或分号后的独立width:声明。allDefaultMinWidth:多列表格首行各单元格 colwidth 摊平后全为 25 时,视为未设列宽;stripSingleColumnColwidths在原有单列表格归一之外叠加该规则(useWikiEditor载入与editorPayload保存两处同款调用点自动生效)。粘贴清洗(
web/src/editor/paste/cleaner.ts)col[style width]归一成width属性的正则同源修复:仅认独立width:,避免站内min-width: 25px表格被复制粘贴回来时被误归一成width="25px"。测试
table-columns.test.ts:仅min-width不产 colwidth、min-width与真实width混合只取真实值、max-width不误读、全 25 多列表剥 colwidth、25 与真实宽度混合保留、colspan 展开全 25 剥除。cleaner.test.ts:仅min-width/max-width不产width属性、混合只留真实width。roundtrip.test.ts:站内min-width表格经粘贴管线回读后单元格无 colwidth。Testing
table-columns、cleaner、roundtrip、table.test.tsx四个文件共 125 项全绿;既有 Confluence 粘贴样本(cleanConfluenceHtml+applyColWidthsFromColgroup)回归全过。App.test.tsx > 已登录且没有页面时,首页给新建入口属并行跑的资源时序抖动,单独重跑通过,与本改动无关。pnpm typecheck(web)通过;biome lint对改动文件无告警。