mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-08 09:48:50 +01:00
🐛 引用嵌套容器块触发状态异常 Fix https://github.com/siyuan-note/siyuan/issues/6967
This commit is contained in:
parent
8f4d20d3dd
commit
24994d993f
1 changed files with 11 additions and 1 deletions
|
|
@ -656,10 +656,20 @@ func GetContainerText(container *ast.Node) string {
|
|||
return ast.WalkContinue
|
||||
}
|
||||
switch n.Type {
|
||||
case ast.NodeText, ast.NodeLinkText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
|
||||
case ast.NodeText, ast.NodeLinkText, ast.NodeFileAnnotationRefText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
|
||||
buf.Write(n.Tokens)
|
||||
case ast.NodeTextMark:
|
||||
buf.WriteString(n.Content())
|
||||
case ast.NodeBlockRef:
|
||||
if anchor := n.ChildByType(ast.NodeBlockRefText); nil != anchor {
|
||||
buf.WriteString(anchor.Text())
|
||||
} else if anchor = n.ChildByType(ast.NodeBlockRefDynamicText); nil != anchor {
|
||||
buf.WriteString(anchor.Text())
|
||||
} else {
|
||||
text := GetRefText(n.TokensStr())
|
||||
buf.WriteString(text)
|
||||
}
|
||||
return ast.WalkSkipChildren
|
||||
}
|
||||
return ast.WalkContinue
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue