You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-06 09:19:22 +02:00
Desktop, Cli: Fixes #3689: Fixed note export when there are folders with non-existing parents. Also fixed long path issue on Windows.
This commit is contained in:
@@ -61,7 +61,10 @@ for (let i = 0; i < 32; i++) {
|
||||
const friendlySafeFilename_blackListNames = ['.', '..', 'CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9'];
|
||||
|
||||
function friendlySafeFilename(e, maxLength = null) {
|
||||
if (maxLength === null) maxLength = 255;
|
||||
// Although Windows supports paths up to 255 characters, but that includes the filename and its
|
||||
// parent directory path. Also there's generally no good reason for dir or file names
|
||||
// to be so long, so keep it at 50, which should prevent various errors.
|
||||
if (maxLength === null) maxLength = 50;
|
||||
if (!e || !e.replace) return _('Untitled');
|
||||
|
||||
let output = '';
|
||||
|
||||
@@ -276,7 +276,9 @@ class InteropService {
|
||||
|
||||
const exportedNoteIds = [];
|
||||
let resourceIds = [];
|
||||
const folderIds = await Folder.allIds();
|
||||
|
||||
// Recursively get all the folders that have valid parents
|
||||
const folderIds = await Folder.childrenIds('', true);
|
||||
|
||||
let fullSourceFolderIds = sourceFolderIds.slice();
|
||||
for (let i = 0; i < sourceFolderIds.length; i++) {
|
||||
@@ -327,7 +329,7 @@ class InteropService {
|
||||
await queueExportItem(BaseModel.TYPE_TAG, exportedTagIds[i]);
|
||||
}
|
||||
|
||||
const exporter = this.newModuleFromPath_('exporter', options);// this.newModuleByFormat_('exporter', exportFormat);
|
||||
const exporter = this.newModuleFromPath_('exporter', options);
|
||||
await exporter.init(exportPath, options);
|
||||
|
||||
const typeOrder = [BaseModel.TYPE_FOLDER, BaseModel.TYPE_RESOURCE, BaseModel.TYPE_NOTE, BaseModel.TYPE_TAG, BaseModel.TYPE_NOTE_TAG];
|
||||
|
||||
Reference in New Issue
Block a user