Browse Source

:art: Use ID when block ref anchor text is empty https://github.com/siyuan-note/siyuan/issues/13606

Daniel 6 tháng trước cách đây
mục cha
commit
7632fc0a27
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      kernel/treenode/node.go

+ 5 - 0
kernel/treenode/node.go

@@ -451,6 +451,11 @@ func SetDynamicBlockRefText(blockRef *ast.Node, refText string) {
 		return
 	}
 
+	refText = strings.TrimSpace(refText)
+	if "" == refText {
+		refText = blockRef.TextMarkBlockRefID
+	}
+
 	blockRef.TextMarkBlockRefSubtype = "d"
 	blockRef.TextMarkTextContent = refText