From 8925bd1cd4f3c488e29569eca5456a290fc7a8e8 Mon Sep 17 00:00:00 2001 From: Symb0x76 <9667434@qq.com> Date: Tue, 14 Oct 2025 15:11:55 +0800 Subject: [PATCH] fix(voice file): introducing copylock to improve accessibility of vocie files --- TODO.md | 4 ++ internal/chatlog/http/route.go | 122 +++++++++------------------------ pkg/filecopy/filecopy.go | 30 ++++---- pkg/util/silk/silk.go | 117 +++++++++++++++++++++++++++++++ 4 files changed, 172 insertions(+), 101 deletions(-) create mode 100644 TODO.md 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) + "