You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Desktop: Fix import interop service (#1887)
* Revert "Revert "Desktop: Add ENEX to HTML export (#1795)"" This reverts commit50b66cceca. * Revert "Revert "Desktop, Cli: Fixed interop service so that it still allow auto-detecting importer based on format (required for Cli and for test units)"" This reverts commitc7c57ab2a5. * Fix the .md importer * Add comment re future refactor * Rm importerClass for .md importer * Fix EnexToMd module name
This commit is contained in:
committed by
Laurent Cozic
parent
8a8ecaade3
commit
172d925f0f
@@ -0,0 +1,22 @@
|
||||
const InteropService_Importer_Base = require('lib/services/InteropService_Importer_Base');
|
||||
const Folder = require('lib/models/Folder.js');
|
||||
const { filename } = require('lib/path-utils.js');
|
||||
|
||||
class InteropService_Importer_EnexToMd extends InteropService_Importer_Base {
|
||||
async exec(result) {
|
||||
const { importEnex } = require('lib/import-enex');
|
||||
|
||||
let folder = this.options_.destinationFolder;
|
||||
|
||||
if (!folder) {
|
||||
const folderTitle = await Folder.findUniqueItemTitle(filename(this.sourcePath_));
|
||||
folder = await Folder.save({ title: folderTitle });
|
||||
}
|
||||
|
||||
await importEnex(folder.id, this.sourcePath_, this.options_);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = InteropService_Importer_EnexToMd;
|
||||
Reference in New Issue
Block a user