mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 15:11:10 +08:00
🎨 Add a Ref export mode Anchor hash
for notebook Markdown exporting https://github.com/siyuan-note/siyuan/issues/10265
This commit is contained in:
parent
9ffa5b7e82
commit
f59f738e5e
@ -1838,8 +1838,9 @@ func exportMarkdownContent0(tree *parse.Tree, cloudAssetsBase string, assetsDest
|
||||
// 如果是定义块,则在开头处添加锚点
|
||||
anchorSpan := &ast.Node{Type: ast.NodeInlineHTML, Tokens: []byte("<span id=\"" + n.ID + "\"></span>")}
|
||||
if ast.NodeDocument != n.Type {
|
||||
if nil != n.FirstChild {
|
||||
n.FirstChild.InsertBefore(anchorSpan)
|
||||
firstLeaf := treenode.FirstLeafBlock(n)
|
||||
if nil != firstLeaf && nil != firstLeaf.FirstChild {
|
||||
firstLeaf.FirstChild.InsertBefore(anchorSpan)
|
||||
} else {
|
||||
n.AppendChild(anchorSpan)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user