导入evernote <en-media问题

This commit is contained in:
life
2015-04-06 20:12:56 +08:00
parent b0601eeb53
commit 9e57a77281
2 changed files with 14 additions and 4 deletions

9
src/node_modules/file.js generated vendored
View File

@@ -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
View File

@@ -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]['$']);
/*