mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ 一些工具函数移动到 gulu 项目中
This commit is contained in:
parent
afbe434239
commit
705f34ccd1
10 changed files with 20 additions and 65 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -44,7 +45,7 @@ func QueryVirtualRefKeywords(name, alias, anchor, doc bool) (ret []string) {
|
|||
if doc {
|
||||
ret = append(ret, queryDocTitles()...)
|
||||
}
|
||||
ret = util.RemoveDuplicatedElem(ret)
|
||||
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
||||
sort.SliceStable(ret, func(i, j int) bool {
|
||||
return len(ret[i]) >= len(ret[j])
|
||||
})
|
||||
|
|
@ -187,7 +188,7 @@ func QueryBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []strin
|
|||
ret = queryDefIDsByDefText(refText, excludeIDs)
|
||||
ret = append(ret, queryDefIDsByNameAlias(refText, excludeIDs)...)
|
||||
ret = append(ret, queryDocIDsByTitle(refText, excludeIDs)...)
|
||||
ret = util.RemoveDuplicatedElem(ret)
|
||||
ret = gulu.Str.RemoveDuplicatedElem(ret)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue