🎨 Improve tag escaping

This commit is contained in:
Daniel 2025-04-23 22:17:06 +08:00
parent fc58892ce8
commit 618269e7df
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 11 additions and 0 deletions

View file

@ -308,6 +308,11 @@ func SearchTags(keyword string) (ret []string) {
labels := labelBlocksByKeyword(keyword)
keyword = strings.Join(strings.Split(keyword, " "), search.TermSep)
for label := range labels {
if "" == keyword {
ret = append(ret, util.EscapeHTML(label))
continue
}
_, t := search.MarkText(label, keyword, 1024, Conf.Search.CaseSensitive)
ret = append(ret, t)
}