1
0
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:
Baptiste Augrain
2020-06-12 16:18:27 +02:00
parent 5414fe3384
commit 80b8948433
6 changed files with 57 additions and 14 deletions

View File

@@ -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)