From feef48d624b0d3b02b547b8024c28093f905aacd Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 29 Jul 2025 15:48:59 +0800 Subject: [PATCH 1/3] :art: https://github.com/siyuan-note/siyuan/issues/15377 --- kernel/model/transaction.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index 0734a05eb..0f65692a2 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -1440,6 +1440,19 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) { cache.PutBlockIAL(updatedNode.ID, parse.IAL2Map(updatedNode.KramdownIAL)) + if ast.NodeHTMLBlock == updatedNode.Type { + content := string(updatedNode.Tokens) + // 剔除连续的空行(包括空行内包含空格的情况) https://github.com/siyuan-note/siyuan/issues/15377 + var newLines []string + lines := strings.Split(content, "\n") + for _, line := range lines { + if strings.TrimSpace(line) != "" { + newLines = append(newLines, line) + } + } + updatedNode.Tokens = []byte(strings.Join(newLines, "\n")) + } + // 替换为新节点 oldNode.InsertAfter(updatedNode) oldNode.Unlink() From f44f9dd5c0dc75d734e9061dfca335cdd40dddb4 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 29 Jul 2025 15:52:04 +0800 Subject: [PATCH 2/3] :art: Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964 --- kernel/model/attribute_view.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index d2793445d..f8e80ac55 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -202,9 +202,9 @@ func hideAttributeViewGroup(avID, blockID, groupID string, hidden int) (err erro err = av.SaveAttributeView(attrView) if err != nil { logging.LogErrorf("save attribute view [%s] failed: %s", avID, err) - return err + return } - return nil + return } func (tx *Transaction) doFoldAttrViewGroup(operation *Operation) (ret *TxErr) { From 95dfaea666d293d0a8525944f4e8a36b200c3ae8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 29 Jul 2025 15:52:30 +0800 Subject: [PATCH 3/3] :art: Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964 --- kernel/model/attribute_view.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index f8e80ac55..f90868e69 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -180,15 +180,11 @@ func (tx *Transaction) doHideAttrViewGroup(operation *Operation) (ret *TxErr) { func hideAttributeViewGroup(avID, blockID, groupID string, hidden int) (err error) { attrView, err := av.ParseAttributeView(avID) if err != nil { - return err + return } view, err := getAttrViewViewByBlockID(attrView, blockID) if err != nil { - return err - } - - if nil == view.Group { return }