@@ -262,7 +262,8 @@ const ExportProgressItem = ({
262262 )
263263 const exportAsMd = async ( noteDoc : NoteDoc , exportPath : string ) => {
264264 const mdString = convertNoteDocToMarkdownString ( noteDoc , includeFrontMatter )
265- await writeFile ( exportPath , mdString )
265+ const filename = `${ exportPath } .md`
266+ await writeFile ( filename , mdString )
266267 }
267268
268269 const exportAsPdf = async (
@@ -279,7 +280,8 @@ const ExportProgressItem = ({
279280 preferences [ 'export.printOptions' ] ,
280281 previewStyle
281282 )
282- await writeFile ( exportPath , pdfBuffer )
283+ const filename = `${ exportPath } .pdf`
284+ await writeFile ( filename , pdfBuffer )
283285 }
284286
285287 const exportAsHtml = async (
@@ -320,10 +322,11 @@ const ExportProgressItem = ({
320322 const exportNoteFilenameWithoutExtension = `${ filenamify (
321323 getValidNoteTitle ( noteDoc )
322324 ) } `
323- const exportNotePathname = join (
325+ const exportNotePathnameNoExt = join (
324326 join ( rootDir , noteExportFolder ) ,
325- ` ${ exportNoteFilenameWithoutExtension } . ${ exportProcedureData . exportType } `
327+ exportNoteFilenameWithoutExtension
326328 )
329+ const exportNotePathname = `${ exportNotePathnameNoExt } .${ exportProcedureData . exportType } `
327330 setExportState ( {
328331 exportProgressValue : convertValueToPercentage (
329332 exportingNoteIndex / notesToExport . length
@@ -353,7 +356,7 @@ const ExportProgressItem = ({
353356 break
354357 case 'md' :
355358 try {
356- await exportAsMd ( noteDoc as NoteDoc , exportNotePathname )
359+ await exportAsMd ( noteDoc as NoteDoc , exportNotePathnameNoExt )
357360 } catch ( err ) {
358361 addExportError (
359362 `Cannot export: '${ exportNotePathname . substring (
@@ -364,7 +367,7 @@ const ExportProgressItem = ({
364367 break
365368 case 'all' :
366369 try {
367- await exportAsMd ( noteDoc as NoteDoc , exportNotePathname )
370+ await exportAsMd ( noteDoc as NoteDoc , exportNotePathnameNoExt )
368371 } catch ( err ) {
369372 addExportError (
370373 `Cannot export: '${ exportNotePathname . substring (
@@ -387,7 +390,7 @@ const ExportProgressItem = ({
387390 try {
388391 await exportAsPdf (
389392 noteDoc as NoteDoc ,
390- exportNotePathname ,
393+ exportNotePathnameNoExt ,
391394 attachmentMap
392395 )
393396 } catch ( err ) {
@@ -403,7 +406,7 @@ const ExportProgressItem = ({
403406 try {
404407 await exportAsPdf (
405408 noteDoc as NoteDoc ,
406- exportNotePathname ,
409+ exportNotePathnameNoExt ,
407410 attachmentMap
408411 )
409412 } catch ( err ) {
0 commit comments