🎨 Improve block ref anchor text exporting Fix https://github.com/siyuan-note/siyuan/issues/11995

This commit is contained in:
Daniel 2024-07-16 10:44:57 +08:00
parent 687421fe62
commit bcd12057bc
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -2009,8 +2009,13 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold bool,
n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n)
case 3: // 仅锚文本
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "text", TextMarkTextContent: linkText}
blockRefLink.KramdownIAL = n.KramdownIAL
var blockRefLink *ast.Node
if 0 < len(n.KramdownIAL) {
blockRefLink = &ast.Node{Type: ast.NodeTextMark, TextMarkType: "text", TextMarkTextContent: linkText}
blockRefLink.KramdownIAL = n.KramdownIAL
} else {
blockRefLink = &ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)}
}
n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n)
case 4: // 脚注