Explorar o código

:art: Improve getRefText https://github.com/siyuan-note/siyuan/issues/10259

Daniel hai 1 ano
pai
achega
fac354c23c
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      kernel/api/block.go

+ 6 - 1
kernel/api/block.go

@@ -318,7 +318,12 @@ func getRefText(c *gin.Context) {
 
 	id := arg["id"].(string)
 	model.WaitForWritingFiles()
-	ret.Data = model.GetBlockRefText(id)
+	refText := model.GetBlockRefText(id)
+	if "" == refText {
+		// 空块返回 id https://github.com/siyuan-note/siyuan/issues/10259
+		refText = id
+	}
+	ret.Data = refText
 }
 
 func getRefIDs(c *gin.Context) {