Skip to content

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

:art: Block ref elements retain their original styles when exported https://github.com/siyuan-note/siyuan/issues/15698

Daniel5b19ff6b8a7c
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 5080766ef0..f95fb31a40 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -2273,10 +2273,9 @@ 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
- if "block-ref" != n.TextMarkType { // 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698
- blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a"))
- blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
- }
+ // 除了块引还有其他元素 https://github.com/siyuan-note/siyuan/issues/15698
+ blockRefLink.TextMarkType = strings.TrimSpace(strings.ReplaceAll(n.TextMarkType, "block-ref", "a"))
+ blockRefLink.TextMarkInlineMemoContent = n.TextMarkInlineMemoContent
n.InsertBefore(blockRefLink)
unlinks = append(unlinks, n)
case 3: // 仅锚文本