This commit is contained in:
Liang Ding 2022-11-20 22:56:51 +08:00
parent f64c3439f4
commit 99e09951ac
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
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") {