diff --git a/kernel/api/block_op.go b/kernel/api/block_op.go index c88bdb50e..69bfae5b8 100644 --- a/kernel/api/block_op.go +++ b/kernel/api/block_op.go @@ -587,7 +587,9 @@ func updateBlock(c *gin.Context) { var ops []*model.Operation for n := oldTree.Root.FirstChild; nil != n; n = n.Next { toRemoves = append(toRemoves, n) - ops = append(ops, &model.Operation{Action: "delete", ID: n.ID}) + ops = append(ops, &model.Operation{Action: "delete", ID: n.ID, Data: map[string]interface{}{ + "createEmptyParagraph": false, // 清空文档后前端不要创建空段落 + }}) } for _, n := range toRemoves { n.Unlink() @@ -707,7 +709,9 @@ func batchUpdateBlock(c *gin.Context) { for n := oldTree.Root.FirstChild; nil != n; n = n.Next { toRemoves = append(toRemoves, n) - ops = append(ops, &model.Operation{Action: "delete", ID: n.ID}) + ops = append(ops, &model.Operation{Action: "delete", ID: n.ID, Data: map[string]interface{}{ + "createEmptyParagraph": false, // 清空文档后前端不要创建空段落 + }}) } for _, n := range toRemoves { n.Unlink()