🐛 复制含链接的块为引用块异常 Fix https://github.com/siyuan-note/siyuan/issues/7426

This commit is contained in:
Liang Ding 2023-02-21 10:48:51 +08:00
parent 740761fcc8
commit 6faff1109c
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 11 additions and 15 deletions

View file

@ -699,9 +699,10 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
fcontent = content
length = utf8.RuneCountInString(fcontent)
} else if n.IsContainerBlock() {
markdown, content = treenode.NodeStaticMdContent(n, luteEngine)
markdown = treenode.ExportNodeStdMd(n, luteEngine)
content = treenode.NodeStaticContent(n, nil, true)
fc := treenode.FirstLeafBlock(n)
fcontent = treenode.NodeStaticContent(fc, nil)
fcontent = treenode.NodeStaticContent(fc, nil, false)
parentID = n.Parent.ID
// 将标题块作为父节点
if h := heading(n); nil != h {
@ -709,7 +710,8 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
}
length = utf8.RuneCountInString(fcontent)
} else {
markdown, content = treenode.NodeStaticMdContent(n, luteEngine)
markdown = treenode.ExportNodeStdMd(n, luteEngine)
content = treenode.NodeStaticContent(n, nil, true)
parentID = n.Parent.ID
// 将标题块作为父节点
if h := heading(n); nil != h {