Merged
Conversation
1. lazy continuation 吞文本:引用块后紧跟的非引用行被 goldmark 错误解析为引用块内容, 通过 normalizeBlockquoteEnding 在引用块末尾插入空行终止 2. 多段落空行丢失:> 段落1\n>\n> 段落2 中间的空行在导入时丢失, convertBlockquote 用计数器在段落间插入空 Text 块 3. 导出空行未还原:convertQuoteContainerWithDepth 跳过了所有空文本子块, 改为跳过开头空行、保留中间空行输出 > 4. 空引用块 fallback:空 QuoteContainer 的子块改为含空内容的 TextRun, 避免飞书 API 拒绝空 Elements 数组
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
Background
三个独立 bug,均与 QuoteContainer 相关:
> 引用\n这行被吞掉)> 段落1\n>\n> 段落2中间的空行在导入时丢失,两个段落合并为一个Usage
导入导出行为修复,无新增 API 或命令。修复前后对比:
Changes
internal/converter/markdown_to_block.gonormalizeBlockquoteEnding预处理函数;convertBlockquote段落间插入空 Text 块;空引用块 fallback 改为含空内容 TextRuninternal/converter/block_to_markdown.goconvertQuoteContainerWithDepth跳过开头空行,保留中间空行输出>internal/converter/markdown_to_block_test.goTest Plan
常规检查
go build ./...编译通过go vet ./...静态检查通过go clean -testcache && go test ./...全部测试通过(除上游已有的TestInit_DefaultValues)新增用例
TestConvert_BlockquoteMultiParagraphWithSurroundingTestNormalizeBlockquoteEnding(4 个子用例)>不处理、末尾空行不插入