Skip to content

Commit 7165c45

Browse files
committed
possibly fix for the broken test...
1 parent 472496d commit 7165c45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

browser/main/lib/dataApi/attachmentManagement.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,12 @@ function replaceNoteKeyWithNewNoteKey (noteContent, oldNoteKey, newNoteKey) {
422422
*/
423423
function removeStorageAndNoteReferences (input, noteKey) {
424424
return input.replace(new RegExp('/?' + STORAGE_FOLDER_PLACEHOLDER + '.*?("|])', 'g'), function (match) {
425-
var encodedPathSeparators = new RegExp(mdurl.encode(path.win32.sep) + '|' + mdurl.encode(path.posix.sep) + '|' + path.win32.sep + '|' + path.posix.sep, 'g')
426-
return match.replace(encodedPathSeparators, path.sep).replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), DESTINATION_FOLDER)
425+
const temp = match
426+
.replace(new RegExp(mdurl.encode(path.win32.sep), 'g'), path.sep)
427+
.replace(new RegExp(mdurl.encode(path.posix.sep), 'g'), path.sep)
428+
.replace(new RegExp(escapeStringRegexp(path.win32.sep), 'g'), path.sep)
429+
.replace(new RegExp(escapeStringRegexp(path.posix.sep), 'g'), path.sep)
430+
return temp.replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), DESTINATION_FOLDER)
427431
})
428432
}
429433

0 commit comments

Comments
 (0)