mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve exporting block ref style https://github.com/siyuan-note/siyuan/issues/16017
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
347b33fbe4
commit
466a147541
1 changed files with 1 additions and 7 deletions
|
|
@ -2283,8 +2283,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
|||
case 2: // 锚文本块链
|
||||
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkTextContent: linkText, TextMarkAHref: "siyuan://blocks/" + defID}
|
||||
blockRefLink.KramdownIAL = n.KramdownIAL
|
||||
// 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698
|
||||
blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a"))
|
||||
blockRefLink.TextMarkType = "a " + n.TextMarkType
|
||||
blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
|
||||
n.InsertBefore(blockRefLink)
|
||||
unlinks = append(unlinks, n)
|
||||
|
|
@ -2334,11 +2333,6 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
|||
n.InsertBefore(&ast.Node{Type: ast.NodeFootnotesRef, Tokens: []byte("^" + refFoot.refNum), FootnotesRefId: refFoot.refNum, FootnotesRefLabel: []byte("^" + refFoot.refNum)})
|
||||
unlinks = append(unlinks, n)
|
||||
}
|
||||
|
||||
if nil != n.Next && ast.NodeKramdownSpanIAL == n.Next.Type {
|
||||
// 引用加排版标记(比如颜色)重叠时丢弃后面的排版属性节点
|
||||
unlinks = append(unlinks, n.Next)
|
||||
}
|
||||
return ast.WalkSkipChildren
|
||||
})
|
||||
for _, n := range unlinks {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue