♻️ 移除旧版中的行级元素实现代码 https://github.com/siyuan-note/siyuan/issues/6819

This commit is contained in:
Liang Ding 2022-12-08 20:32:42 +08:00
parent c69983c56c
commit 637f1427e4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
11 changed files with 24 additions and 322 deletions

View file

@ -656,21 +656,10 @@ func GetContainerText(container *ast.Node) string {
return ast.WalkContinue
}
switch n.Type {
case ast.NodeText, ast.NodeLinkText, ast.NodeFileAnnotationRefText, ast.NodeFootnotesRef,
ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
case ast.NodeText, ast.NodeLinkText, 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
})