An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/13987
Danielca179523c30e
diff --git a/kernel/model/export.go b/kernel/model/export.goindex 60f93567e9..2d910e7fb3 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -2583,7 +2583,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,// 导出时去掉内容块闪卡样式 https://github.com/siyuan-note/siyuan/issues/7374if n.IsBlock() {- n.RemoveIALAttr("custom-riff-decks")+ n.RemoveIALAttr(NodeAttrRiffDecks)}switch n.Type {diff --git a/kernel/model/file.go b/kernel/model/file.goindex 339bd4c4e9..b64ce57a8d 100644--- a/kernel/model/file.go+++ b/kernel/model/file.go@@ -985,15 +985,19 @@ func DuplicateDoc(tree *parse.Tree) {previousPath := tree.PathresetTree(tree, "Duplicated", false)- // 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {if !entering || !n.IsBlock() {return ast.WalkContinue}+ // 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294n.RemoveIALAttr(av.NodeAttrNameAvs)n.RemoveIALAttr(av.NodeAttrViewNames)n.RemoveIALAttrsByPrefix(av.NodeAttrViewStaticText)++ // 复制为副本时移除闪卡相关属性 https://github.com/siyuan-note/siyuan/issues/13987+ n.RemoveIALAttr(NodeAttrRiffDecks)+return ast.WalkContinue})diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.goindex 59e6b42c36..229d1b185c 100644--- a/kernel/model/flashcard.go+++ b/kernel/model/flashcard.go@@ -804,7 +804,7 @@ func (tx *Transaction) removeBlocksDeckAttr(blockIDs []string, deckID string) (eoldAttrs := parse.IAL2Map(node.KramdownIAL)- deckAttrs := node.IALAttr("custom-riff-decks")+ deckAttrs := node.IALAttr(NodeAttrRiffDecks)var deckIDs []stringif "" != deckID {availableDeckIDs := getDeckIDs()@@ -820,9 +820,9 @@ func (tx *Transaction) removeBlocksDeckAttr(blockIDs []string, deckID string) (eval = strings.TrimPrefix(val, ",")val = strings.TrimSuffix(val, ",")if "" == val {- node.RemoveIALAttr("custom-riff-decks")+ node.RemoveIALAttr(NodeAttrRiffDecks)} else {- node.SetIALAttr("custom-riff-decks", val)+ node.SetIALAttr(NodeAttrRiffDecks, val)}tx.writeTree(tree)@@ -910,14 +910,14 @@ func (tx *Transaction) doAddFlashcards(operation *Operation) (ret *TxErr) {oldAttrs := parse.IAL2Map(node.KramdownIAL)- deckAttrs := node.IALAttr("custom-riff-decks")+ deckAttrs := node.IALAttr(NodeAttrRiffDecks)deckIDs := strings.Split(deckAttrs, ",")deckIDs = append(deckIDs, deckID)deckIDs = gulu.Str.RemoveDuplicatedElem(deckIDs)val := strings.Join(deckIDs, ",")val = strings.TrimPrefix(val, ",")val = strings.TrimSuffix(val, ",")- node.SetIALAttr("custom-riff-decks", val)+ node.SetIALAttr(NodeAttrRiffDecks, val)tx.writeTree(tree)@@ -1195,3 +1195,7 @@ func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string, newCar}return}++const (+ NodeAttrRiffDecks = "custom-riff-decks"+)