Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve exporting block ref style https://github.com/siyuan-note/siyuan/issues/16017

Daniel466a1475416f
diff --git a/kernel/model/export.go b/kernel/model/export.go
index d22cebb40c..77c7df7cde 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -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 {