mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 01:59:05 +08:00
This commit is contained in:
parent
7a138a5836
commit
0428d050d0
@ -83,6 +83,9 @@ func searchTag(c *gin.Context) {
|
|||||||
|
|
||||||
k := arg["k"].(string)
|
k := arg["k"].(string)
|
||||||
tags := model.SearchTags(k)
|
tags := model.SearchTags(k)
|
||||||
|
if 1 > len(tags) {
|
||||||
|
tags = []string{}
|
||||||
|
}
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"tags": tags,
|
"tags": tags,
|
||||||
"k": k,
|
"k": k,
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/siyuan-note/logging"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -282,6 +283,7 @@ func sortTags(tags Tags) {
|
|||||||
|
|
||||||
func SearchTags(keyword string) (ret []string) {
|
func SearchTags(keyword string) (ret []string) {
|
||||||
ret = []string{}
|
ret = []string{}
|
||||||
|
defer logging.Recover() // TODO: 定位 无法添加题头图标签 https://github.com/siyuan-note/siyuan/issues/6756
|
||||||
|
|
||||||
labels := labelBlocksByKeyword(keyword)
|
labels := labelBlocksByKeyword(keyword)
|
||||||
for label, _ := range labels {
|
for label, _ := range labels {
|
||||||
|
Loading…
Reference in New Issue
Block a user