mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Ignore the last empty paragraph block when exporting merged sub-documents https://github.com/siyuan-note/siyuan/issues/15028
This commit is contained in:
parent
31121977ec
commit
4f4efbdf10
1 changed files with 9 additions and 2 deletions
|
|
@ -76,8 +76,15 @@ func walkBlock(insertPoint *ast.Node, block *Block, level int) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for j := len(nodes) - 1; -1 < j; j-- {
|
lastIndex := len(nodes) - 1
|
||||||
insertPoint.InsertAfter(nodes[j])
|
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
|
block.Children = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue