mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 嵌入块纳入引用计数和反链 https://github.com/siyuan-note/siyuan/issues/7096
This commit is contained in:
parent
5ada15c0ed
commit
9c626ebc0b
1 changed files with 4 additions and 10 deletions
|
|
@ -342,8 +342,7 @@ func buildRef(tree *parse.Tree, refNode *ast.Node) *Ref {
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildEmbedRef(tree *parse.Tree, embedNode *ast.Node) *Ref {
|
func buildEmbedRef(tree *parse.Tree, embedNode *ast.Node) *Ref {
|
||||||
markdown := treenode.ExportNodeStdMd(embedNode, luteEngine)
|
defBlockID := getEmbedRef(embedNode)
|
||||||
defBlockID, text := getEmbedRef(embedNode)
|
|
||||||
var defBlockParentID, defBlockRootID, defBlockPath string
|
var defBlockParentID, defBlockRootID, defBlockPath string
|
||||||
defBlock := treenode.GetBlockTree(defBlockID)
|
defBlock := treenode.GetBlockTree(defBlockID)
|
||||||
if nil != defBlock {
|
if nil != defBlock {
|
||||||
|
|
@ -362,19 +361,14 @@ func buildEmbedRef(tree *parse.Tree, embedNode *ast.Node) *Ref {
|
||||||
RootID: tree.ID,
|
RootID: tree.ID,
|
||||||
Box: tree.Box,
|
Box: tree.Box,
|
||||||
Path: tree.Path,
|
Path: tree.Path,
|
||||||
Content: text,
|
Content: "",
|
||||||
Markdown: markdown,
|
Markdown: "",
|
||||||
Type: treenode.TypeAbbr(embedNode.Type.String()),
|
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)
|
queryBlockID = treenode.GetEmbedBlockRef(embedNode)
|
||||||
if "" == queryBlockID {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
refText = getRefText(queryBlockID)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue