fix new tab file extension (#2755)

This commit is contained in:
Jia Hao xiang 2022-02-05 03:38:33 +08:00 committed by GitHub
parent 08c2290a04
commit 1433dc0eac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,6 +133,8 @@ const handleResponseForSave = async (e, { id, filename, markdown, pathname, opti
}
filePath = path.resolve(filePath)
const extension = path.extname(filePath) || '.md'
filePath = !filePath.endsWith(extension) ? filePath += extension : filePath
return writeMarkdownFile(filePath, markdown, options, win)
.then(() => {
if (!alreadyExistOnDisk) {