🎨 Ignore the last empty paragraph block when exporting merged sub-documents https://github.com/siyuan-note/siyuan/issues/15028

This commit is contained in:
Daniel 2025-06-14 12:09:23 +08:00
parent 31121977ec
commit 4f4efbdf10
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -76,8 +76,15 @@ func walkBlock(insertPoint *ast.Node, block *Block, level int) (err error) {
return
}
for j := len(nodes) - 1; -1 < j; j-- {
insertPoint.InsertAfter(nodes[j])
lastIndex := len(nodes) - 1
for j := lastIndex; -1 < j; j-- {
node := nodes[j]
if j == lastIndex && ast.NodeParagraph == node.Type && nil == node.FirstChild {
// 跳过最后一个空段落块
// Ignore the last empty paragraph block when exporting merged sub-documents https://github.com/siyuan-note/siyuan/issues/15028
continue
}
insertPoint.InsertAfter(node)
}
}
block.Children = nil