fix: safe file name

close #1129
This commit is contained in:
Stephen Zhou 2024-10-25 17:14:22 +08:00
parent c8ccf352f2
commit 3af3935fca
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -241,7 +241,7 @@ export const appRoute = {
try {
const { url, title, content, author, publishedAt, vaultPath } = input
const fileName = `${(title || publishedAt).trim().slice(0, 20)}.md`
const fileName = `${(title || publishedAt).trim().slice(0, 20).replaceAll("/", "-")}.md`
const filePath = path.join(vaultPath, fileName)
const exists = fs.existsSync(filePath)
if (exists) {