From 1433dc0eac7ecac59b3adfcb5fdfb7d30b26670c Mon Sep 17 00:00:00 2001 From: Jia Hao xiang <36227914+jhxqy@users.noreply.github.com> Date: Sat, 5 Feb 2022 03:38:33 +0800 Subject: [PATCH] fix new tab file extension (#2755) --- src/main/menu/actions/file.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/menu/actions/file.js b/src/main/menu/actions/file.js index 96e35ab8..ff44b711 100644 --- a/src/main/menu/actions/file.js +++ b/src/main/menu/actions/file.js @@ -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) {