Просмотр исходного кода

:bug: 重命名书签后属性面板中的书签属性没有更改 Fix https://github.com/siyuan-note/siyuan/issues/5207

Liang Ding 3 лет назад
Родитель
Сommit
fca47bae6c
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      kernel/model/bookmark.go

+ 4 - 0
kernel/model/bookmark.go

@@ -22,6 +22,8 @@ import (
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 
 
+	"github.com/88250/lute/parse"
+	"github.com/siyuan-note/siyuan/kernel/cache"
 	"github.com/siyuan-note/siyuan/kernel/sql"
 	"github.com/siyuan-note/siyuan/kernel/sql"
 	"github.com/siyuan-note/siyuan/kernel/treenode"
 	"github.com/siyuan-note/siyuan/kernel/treenode"
 	"github.com/siyuan-note/siyuan/kernel/util"
 	"github.com/siyuan-note/siyuan/kernel/util"
@@ -56,6 +58,7 @@ func RemoveBookmark(bookmark string) (err error) {
 
 
 			if bookmarkAttrVal := node.IALAttr("bookmark"); bookmarkAttrVal == bookmark {
 			if bookmarkAttrVal := node.IALAttr("bookmark"); bookmarkAttrVal == bookmark {
 				node.RemoveIALAttr("bookmark")
 				node.RemoveIALAttr("bookmark")
+				cache.PutBlockIAL(node.ID, parse.IAL2Map(node.KramdownIAL))
 			}
 			}
 		}
 		}
 
 
@@ -115,6 +118,7 @@ func RenameBookmark(oldBookmark, newBookmark string) (err error) {
 
 
 			if bookmarkAttrVal := node.IALAttr("bookmark"); bookmarkAttrVal == oldBookmark {
 			if bookmarkAttrVal := node.IALAttr("bookmark"); bookmarkAttrVal == oldBookmark {
 				node.SetIALAttr("bookmark", newBookmark)
 				node.SetIALAttr("bookmark", newBookmark)
+				cache.PutBlockIAL(node.ID, parse.IAL2Map(node.KramdownIAL))
 			}
 			}
 		}
 		}