mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Add internal kernel API /api/setting/addVirtualBlockRefInclude and addVirtualBlockRefExclude https://github.com/siyuan-note/siyuan/issues/9909
This commit is contained in:
parent
32ce33d0fb
commit
9052e4ff92
2 changed files with 3 additions and 6 deletions
|
|
@ -47,6 +47,7 @@ func addVirtualBlockRefExclude(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
model.AddVirtualBlockRefExclude(keywords)
|
model.AddVirtualBlockRefExclude(keywords)
|
||||||
|
util.BroadcastByType("main", "setConf", 0, "", model.Conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addVirtualBlockRefInclude(c *gin.Context) {
|
func addVirtualBlockRefInclude(c *gin.Context) {
|
||||||
|
|
@ -67,6 +68,7 @@ func addVirtualBlockRefInclude(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
model.AddVirtualBlockRefInclude(keywords)
|
model.AddVirtualBlockRefInclude(keywords)
|
||||||
|
util.BroadcastByType("main", "setConf", 0, "", model.Conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func refreshVirtualBlockRef(c *gin.Context) {
|
func refreshVirtualBlockRef(c *gin.Context) {
|
||||||
|
|
@ -76,6 +78,7 @@ func refreshVirtualBlockRef(c *gin.Context) {
|
||||||
defer c.JSON(http.StatusOK, ret)
|
defer c.JSON(http.StatusOK, ret)
|
||||||
|
|
||||||
model.ResetVirtualBlockRefCache()
|
model.ResetVirtualBlockRefCache()
|
||||||
|
util.BroadcastByType("main", "setConf", 0, "", model.Conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setBazaar(c *gin.Context) {
|
func setBazaar(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -118,9 +118,6 @@ func AddVirtualBlockRefInclude(keyword []string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Conf.m.Lock()
|
|
||||||
defer Conf.m.Unlock()
|
|
||||||
|
|
||||||
include := strings.ReplaceAll(Conf.Editor.VirtualBlockRefInclude, "\\,", "__comma@sep__")
|
include := strings.ReplaceAll(Conf.Editor.VirtualBlockRefInclude, "\\,", "__comma@sep__")
|
||||||
includes := strings.Split(include, ",")
|
includes := strings.Split(include, ",")
|
||||||
includes = append(includes, keyword...)
|
includes = append(includes, keyword...)
|
||||||
|
|
@ -136,9 +133,6 @@ func AddVirtualBlockRefExclude(keyword []string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Conf.m.Lock()
|
|
||||||
defer Conf.m.Unlock()
|
|
||||||
|
|
||||||
exclude := strings.ReplaceAll(Conf.Editor.VirtualBlockRefExclude, "\\,", "__comma@sep__")
|
exclude := strings.ReplaceAll(Conf.Editor.VirtualBlockRefExclude, "\\,", "__comma@sep__")
|
||||||
excludes := strings.Split(exclude, ",")
|
excludes := strings.Split(exclude, ",")
|
||||||
excludes = append(excludes, keyword...)
|
excludes = append(excludes, keyword...)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue