🎨 嵌入块纳入引用计数和反链 https://github.com/siyuan-note/siyuan/issues/7096

This commit is contained in:
Liang Ding 2023-01-18 13:58:58 +08:00
parent 5ada15c0ed
commit 9c626ebc0b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -342,8 +342,7 @@ func buildRef(tree *parse.Tree, refNode *ast.Node) *Ref {
}
func buildEmbedRef(tree *parse.Tree, embedNode *ast.Node) *Ref {
markdown := treenode.ExportNodeStdMd(embedNode, luteEngine)
defBlockID, text := getEmbedRef(embedNode)
defBlockID := getEmbedRef(embedNode)
var defBlockParentID, defBlockRootID, defBlockPath string
defBlock := treenode.GetBlockTree(defBlockID)
if nil != defBlock {
@ -362,19 +361,14 @@ func buildEmbedRef(tree *parse.Tree, embedNode *ast.Node) *Ref {
RootID: tree.ID,
Box: tree.Box,
Path: tree.Path,
Content: text,
Markdown: markdown,
Content: "",
Markdown: "",
Type: treenode.TypeAbbr(embedNode.Type.String()),
}
}
func getEmbedRef(embedNode *ast.Node) (queryBlockID, refText string) {
func getEmbedRef(embedNode *ast.Node) (queryBlockID string) {
queryBlockID = treenode.GetEmbedBlockRef(embedNode)
if "" == queryBlockID {
return
}
refText = getRefText(queryBlockID)
return
}