From b62384428b511840678de5b7b16f4310d34dfbbd Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 11 Jan 2025 16:48:26 +0800 Subject: [PATCH 1/3] :art: Improve indexing --- kernel/sql/database.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sql/database.go b/kernel/sql/database.go index 80110567d..94641d793 100644 --- a/kernel/sql/database.go +++ b/kernel/sql/database.go @@ -741,6 +741,9 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) ( if ast.NodeInlineHTML == n.Type { // 没有行级 HTML,只有块级 HTML,这里转换为块 + n.ID = ast.NewNodeID() + n.SetIALAttr("id", n.ID) + n.SetIALAttr("updated", n.ID[:14]) b, attrs := buildBlockFromNode(n, tree) b.Type = ast.NodeHTMLBlock.String() blocks = append(blocks, b) From 4102e371f5fc32b4e6f2515e115c7eb615cf5484 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 11 Jan 2025 16:49:46 +0800 Subject: [PATCH 2/3] :art: Improve indexing --- kernel/sql/database.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sql/database.go b/kernel/sql/database.go index 94641d793..775f80efa 100644 --- a/kernel/sql/database.go +++ b/kernel/sql/database.go @@ -749,6 +749,7 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) ( blocks = append(blocks, b) attributes = append(attributes, attrs...) walkStatus = ast.WalkContinue + logging.LogWarnf("inline HTML [%s] is converted to HTML block ", n.Tokens) return } From ef0142a1bc6cb11798ac25341ede9521ee1a82a7 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 11 Jan 2025 17:05:36 +0800 Subject: [PATCH 3/3] :art: Improve formatting https://github.com/siyuan-note/siyuan/issues/13786 --- kernel/model/box.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/box.go b/kernel/model/box.go index ab2d262cc..0d89c81cf 100644 --- a/kernel/model/box.go +++ b/kernel/model/box.go @@ -513,7 +513,7 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) { } id := n.IALAttr("id") - if "" == id { + if "" == id && n.IsBlock() { n.SetIALAttr("id", n.ID) }