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

Desktop: Fixes #5034: Certain resource paths could be corrupted when saved from the Rich Text editor

This commit is contained in:
Laurent Cozic
2021-06-08 20:37:44 +02:00
parent a058e09183
commit 56fdf97693
2 changed files with 16 additions and 4 deletions

View File

@ -284,8 +284,20 @@ describe('models_Note', function() {
expect(externalToInternal).toBe(input);
}
const result = await Note.replaceResourceExternalToInternalLinks(`[](joplin://${note1.id})`);
expect(result).toBe(`[](:/${note1.id})`);
{
const result = await Note.replaceResourceExternalToInternalLinks(`[](joplin://${note1.id})`);
expect(result).toBe(`[](:/${note1.id})`);
}
{
// This is a regular file path that contains the resourceDirName
// inside but it shouldn't be changed.
//
// https://github.com/laurent22/joplin/issues/5034
const noChangeInput = `[docs](file:///c:/foo/${resourceDirName}/docs)`;
const result = await Note.replaceResourceExternalToInternalLinks(noChangeInput, { useAbsolutePaths: false });
expect(result).toBe(noChangeInput);
}
}));
it('should perform natural sorting', (async () => {