fix: sanitize tab chars and avoid double .md extension in manual download filename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wizardchen
2026-03-16 18:18:23 +08:00
parent 66c384823b
commit 2fd6e226a5
2 changed files with 15 additions and 2 deletions
@@ -72,6 +72,16 @@ func TestSanitizeManualDownloadFilename(t *testing.T) {
title: "知识库文章",
want: "知识库文章.md",
},
{
name: "tab character stripped",
title: "file\tname",
want: "filename.md",
},
{
name: "title already ending in .md not double-extended",
title: "guide.md",
want: "guide.md",
},
}
for _, tt := range tests {