Repository navigation
fix(card): 图片行预扫描识别跨行 code span,不再把代码内双图行提升为原生 img - #2869
Merged
Merged
Conversation
行级预扫描只对 fence 感知,不认行内 code span。被跨行 code span 包住的 ` ` 行会被提升成原生 column_set + img,img_key 形如 key 但无 法解析,飞书校验失败 → 整卡 230099/200570 拒收 → 整卡去图兜底,同卡有效 图片一并丢失。 改为提升前与 markdown-it 的 token 认知对齐:按字符偏移确认该行的 `![` 确实是图片 token 才提升;单图尺寸模式同加这道闸。只在整行像图片时才解析 一次,普通正文无额外开销。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
swtxbling
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 5, 2026 18:02
Owner
|
感谢贡献,已 squash 合入 master 🎉 跨行 code span 包住的假图行不再被提升为原生图片,避免了形似 key 的 src 导致整卡被飞书拒收(230099/200570)、连带同卡有效图片一起被去图兜底的问题;真实并排图行的渲染保持不变。 评审中确认的两个既有现象(非本 PR 引入,不影响本次合入):单图尺寸模式(small/medium/tiny)实际产出带空列的 column_set;code span 恰在图片行行首闭合时该行按保守策略不提升。后续若有需要会另行跟进。 |
This was referenced Nov 6, 2026
|
🚀 Released in v3.58.0 |
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.
改了什么
src/im/lark/md-card.ts的splitImageRowSegments行级预扫描在把「整行都是图片」的行提升为原生column_set+img(以及单图尺寸模式的原生img)之前,先用cardMarkdownImageReferences(markdown-it token)确认该行每个 这种 code span 恰好在图片行行首闭合的情况不提升(保守,不会造成拒收)。Closes #2803
🤖 Generated with Claude Code