mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-20 10:45:01 +00:00
导入evernote <en-media问题
This commit is contained in:
9
src/node_modules/file.js
generated
vendored
9
src/node_modules/file.js
generated
vendored
@@ -37,6 +37,7 @@ var File = {
|
||||
var filename = Common.uuid() + '.' + type;
|
||||
if(isImage) {
|
||||
var basePath = User.getCurUserImagesPath();
|
||||
|
||||
} else {
|
||||
var basePath = User.getCurUserAttachsPath();
|
||||
}
|
||||
@@ -86,10 +87,11 @@ var File = {
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
// console.log(txtPath);
|
||||
// console.log(filePath);
|
||||
Common.cmd([txtPath, filePath], function(code) {
|
||||
console.log('子进程已关闭,代码:' + code);
|
||||
fs.unlink(txtPath);
|
||||
// console.log('子进程已关闭,代码:' + code);
|
||||
// fs.unlink(txtPath);
|
||||
if(!code) {
|
||||
try {
|
||||
if(isImage) {
|
||||
@@ -101,6 +103,7 @@ var File = {
|
||||
me._addAttach(filePath, fileTitle, callback)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
callback(false);
|
||||
}
|
||||
} else {
|
||||
|
9
src/node_modules/import.js
generated
vendored
9
src/node_modules/import.js
generated
vendored
@@ -36,7 +36,7 @@ var Import = {
|
||||
if(!content) {
|
||||
return '';
|
||||
}
|
||||
var reg = new RegExp("<en\-media(.*?)\/>", "g");
|
||||
var reg = new RegExp("<en\-media(.*?)\/*>", "g"); // <en-media /> <en-media></en-media>
|
||||
var i = 0;
|
||||
// console.log(content);
|
||||
while(ret = reg.exec(content)) {
|
||||
@@ -59,6 +59,10 @@ var Import = {
|
||||
};
|
||||
};
|
||||
|
||||
// 如果是<en-media></en-media>, </en-media>匹配不到
|
||||
content = content.replace(/<\/en-media>/g, '');
|
||||
|
||||
|
||||
return content;
|
||||
},
|
||||
|
||||
@@ -83,6 +87,9 @@ var Import = {
|
||||
var resources = note['resource'] || [];
|
||||
var parsedRes = [];
|
||||
var attachs = [];
|
||||
console.log("-----------")
|
||||
console.log(note);
|
||||
console.log(resources);
|
||||
async.eachSeries(resources, function(res, cb) {
|
||||
// console.log(res['data'][0]['$']);
|
||||
/*
|
||||
|
Reference in New Issue
Block a user