1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Fixed regressions following fix for #1425

This commit is contained in:
Laurent Cozic
2019-05-11 12:08:28 +01:00
parent b702b0b40c
commit afb375955e
3 changed files with 24 additions and 21 deletions

View File

@ -178,14 +178,14 @@ class Note extends BaseItem {
const resource = await Resource.load(id);
if (!resource) continue;
const resourcePath = Resource.relativePath(resource)
body = body.replace(new RegExp(':/' + id, 'gi'), resourcePath); //toFileProtocolPath(Resource.fullPath(resource)));
body = body.replace(new RegExp(':/' + id, 'gi'), resourcePath);
}
return body;
}
static async replaceResourceExternalToInternalLinks(body) {
const reString = pregQuote(toFileProtocolPath(Resource.baseRelativeDirectoryPath() + '/')) + '[a-zA-Z0-9\.]+';
const reString = pregQuote(Resource.baseRelativeDirectoryPath() + '/') + '[a-zA-Z0-9\.]+';
const re = new RegExp(reString, 'gi');
body = body.replace(re, (match) => {
const id = Resource.pathToId(match);