diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..00fc82e --- /dev/null +++ b/TODO.md @@ -0,0 +1,4 @@ +# TODO + +- [ ] 修复 html 渲染部分头像缺失的问题 +- [ ] 美化搜索界面使风格一致 diff --git a/internal/chatlog/http/route.go b/internal/chatlog/http/route.go index 2a4e7d2..fef22af 100644 --- a/internal/chatlog/http/route.go +++ b/internal/chatlog/http/route.go @@ -906,7 +906,9 @@ func (s *Service) handleSearch(c *gin.Context) { resp.Offset = offset format := strings.ToLower(strings.TrimSpace(params.Format)) - terms := extractQueryTerms(resp.Query) + if format == "" { + format = "json" + } switch format { case "html": @@ -966,9 +968,9 @@ func (s *Service) handleSearch(c *gin.Context) { c.Writer.WriteString("") c.Writer.WriteString("
") if snippet := strings.TrimSpace(hit.Snippet); snippet != "" { - h := highlightPlainTextToHTML(snippet, terms) - h = strings.ReplaceAll(h, "\n", "" + messageHTMLPlaceholder(msg) + "