Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-11-20 23:04:26 +08:00
commit b61ebcefe5
2 changed files with 10 additions and 1 deletions

View file

@ -489,6 +489,7 @@ func scanBlockRows(rows *sql.Rows) (ret *Block) {
return
}
ret = &block
putBlockCache(ret)
return
}

View file

@ -25,6 +25,7 @@ import (
"github.com/88250/lute/parse"
"github.com/emirpasic/gods/sets/hashset"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/search"
)
func QueryVirtualRefKeywords(name, alias, anchor, doc bool) (ret []string) {
@ -149,7 +150,14 @@ func QueryRefRootBlocksByDefRootID(defRootID string) (ret []*Block) {
return
}
func GetRefText(defBlockID string) string {
func GetRefText(defBlockID string) (ret string) {
ret = getRefText(defBlockID)
ret = strings.ReplaceAll(ret, search.SearchMarkLeft, "")
ret = strings.ReplaceAll(ret, search.SearchMarkRight, "")
return
}
func getRefText(defBlockID string) string {
block := GetBlock(defBlockID)
if nil == block {
if strings.HasPrefix(defBlockID, "assets") {