Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var hashes = attrs.match(/hash="([0-9a-zA-Z]{32})"/);
var hash = '';
if (hashes) {
hash = hashes[1];
}
if (!hash) {
continue;
}
var res = parsedRes[hash];
var fileId = res['FileId'];
if(!fileId) {
continue;
}
if(res.IsImage) {
var replace = '<img src="' + Evt.getImageLocalUrl(fileId) + '">';
} else {
var replace = '<a href="' + Evt.getAttachLocalUrl(fileId) + '">' + res['Title'] + '</a>'
}
content = content.replace(ret[0], replace);
} catch(e) {
console.log(e);
};
};
// 如果是, 匹配不到
content = content.replace(/<\/en-media>/g, '');
return content;
},
me._addImage(Common.objectId(), filePath, function(newImg) {
callback && callback(Evt.getImageLocalUrl(newImg.FileId));
});
});
me._addImage(Common.objectId(), filePath, function(newImg) {
callback && callback(Evt.getImageLocalUrl(newImg.FileId));
});
});
me._addImage(Common.objectId(), filePath, function(newImg) {
callback && callback(Evt.getImageLocalUrl(newImg.FileId));
});
});