Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix: remove SanitizeForDisplay from chunk handler responses

MidoriKurage002434bbb3da
diff --git a/internal/handler/chunk.go b/internal/handler/chunk.go
index cfc5142a9..041bdcf1a 100644
--- a/internal/handler/chunk.go
+++ b/internal/handler/chunk.go
@@ -75,11 +75,6 @@ func (h *ChunkHandler) GetChunkByIDOnly(c *gin.Context) {
return
}
- // 对 chunk 内容进行安全清理
- if chunk.Content != "" {
- chunk.Content = secutils.SanitizeForDisplay(chunk.Content)
- }
-
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": chunk,
@@ -146,13 +141,6 @@ func (h *ChunkHandler) ListKnowledgeChunks(c *gin.Context) {
return
}
- // 对 chunk 内容进行安全清理
- for _, chunk := range result.Data.([]*types.Chunk) {
- if chunk.Content != "" {
- chunk.Content = secutils.SanitizeForDisplay(chunk.Content)
- }
- }
-
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": result.Data,
diff --git a/internal/handler/embed_channel.go b/internal/handler/embed_channel.go
index 233b38b21..df60f51e4 100644
--- a/internal/handler/embed_channel.go
+++ b/internal/handler/embed_channel.go
@@ -366,9 +366,6 @@ func (h *EmbedChannelHandler) GetEmbedChunk(c *gin.Context) {
}
return
}
- if chunk.Content != "" {
- chunk.Content = secutils.SanitizeForDisplay(chunk.Content)
- }
c.JSON(http.StatusOK, gin.H{"success": true, "data": chunk})
}