mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 03:50:27 +08:00
fix new tab file extension (#2755)
This commit is contained in:
parent
08c2290a04
commit
1433dc0eac
@ -133,6 +133,8 @@ const handleResponseForSave = async (e, { id, filename, markdown, pathname, opti
|
|||||||
}
|
}
|
||||||
|
|
||||||
filePath = path.resolve(filePath)
|
filePath = path.resolve(filePath)
|
||||||
|
const extension = path.extname(filePath) || '.md'
|
||||||
|
filePath = !filePath.endsWith(extension) ? filePath += extension : filePath
|
||||||
return writeMarkdownFile(filePath, markdown, options, win)
|
return writeMarkdownFile(filePath, markdown, options, win)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (!alreadyExistOnDisk) {
|
if (!alreadyExistOnDisk) {
|
||||||
|
Loading…
Reference in New Issue
Block a user