♻️ 提取获取 node 锚文本的函数

This commit is contained in:
Liang Ding 2022-09-30 22:33:24 +08:00
parent 1feecff511
commit 3555df9267
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -91,7 +91,10 @@ func GetBlockRefText(id string) string {
if nil == node {
return ErrBlockNotFound.Error()
}
return getNodeRefText(node)
}
func getNodeRefText(node *ast.Node) string {
if name := node.IALAttr("name"); "" != name {
return name
}