mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
- export untitled notes as 'Untitled' based on the language
- export notes with duplicate title as '<title> (<index>)'
This commit is contained in:
@@ -7,6 +7,7 @@ import fs from 'fs'
|
||||
import exportNote from './exportNote'
|
||||
import formatMarkdown from './formatMarkdown'
|
||||
import formatHTML from './formatHTML'
|
||||
import getFilename from './getFilename'
|
||||
|
||||
/**
|
||||
* @param {String} storageKey
|
||||
@@ -83,11 +84,15 @@ function exportStorage(storageKey, fileType, exportDir, config) {
|
||||
} catch (e) {}
|
||||
})
|
||||
|
||||
const deduplicator = {}
|
||||
|
||||
return Promise.all(
|
||||
notes.map(note => {
|
||||
const targetPath = path.join(
|
||||
folderNamesMapping[note.folder],
|
||||
`${filenamify(note.title, { replacement: '_' })}.${fileType}`
|
||||
const targetPath = getFilename(
|
||||
note,
|
||||
fileType,
|
||||
exportDir,
|
||||
deduplicator
|
||||
)
|
||||
|
||||
return exportNote(storage.key, note, targetPath, contentFormatter)
|
||||
|
||||
Reference in New Issue
Block a user