diff --git a/browser/main/lib/dataApi/attachmentManagement.js b/browser/main/lib/dataApi/attachmentManagement.js index 980bf859..4eec7ca6 100644 --- a/browser/main/lib/dataApi/attachmentManagement.js +++ b/browser/main/lib/dataApi/attachmentManagement.js @@ -388,7 +388,7 @@ function removeStorageAndNoteReferences (input, noteKey) { /** * @description replace all :storage references with given destination folder. - * @param input Input in which the references should be deleted + * @param input Input in which the references should be replaced * @param noteKey Key of the current note * @param destinationFolder Destination folder of the attachements * @returns {String} Input without the references diff --git a/tests/dataApi/attachmentManagement.test.js b/tests/dataApi/attachmentManagement.test.js index a4cc8082..4b40e0d2 100644 --- a/tests/dataApi/attachmentManagement.test.js +++ b/tests/dataApi/attachmentManagement.test.js @@ -334,6 +334,64 @@ it('should make sure that "removeStorageAndNoteReferences" works with markdown c expect(actual).toEqual(expectedOutput) }) +it('should replace the all ":storage" references', function () { + const storageFolder = systemUnderTest.DESTINATION_FOLDER + const noteKey = 'noteKey' + const testInput = + '\n' + + '
\n' + + ' //header\n' + + ' \n' + + ' \n' + + '\n' +
+ '
\n' +
+ '
\n' + + ' dummyPDF.pdf\n' + + '
\n' + + '\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' + + ' dummyPDF.pdf\n' + + '
\n' + + '\n' +
+ '
\n' +
+ '