mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Fix regex
This commit is contained in:
@@ -713,14 +713,20 @@ function replaceNoteKeyWithNewNoteKey(noteContent, oldNoteKey, newNoteKey) {
|
|||||||
*/
|
*/
|
||||||
function removeStorageAndNoteReferences(input, noteKey) {
|
function removeStorageAndNoteReferences(input, noteKey) {
|
||||||
return input.replace(
|
return input.replace(
|
||||||
new RegExp('/?' + STORAGE_FOLDER_PLACEHOLDER + '.*?("|])', 'g'),
|
new RegExp('/?' + STORAGE_FOLDER_PLACEHOLDER + '.*?("|\\))', 'g'),
|
||||||
function(match) {
|
function(match) {
|
||||||
const temp = match
|
return match
|
||||||
.replace(new RegExp(mdurl.encode(path.win32.sep), 'g'), path.sep)
|
.replace(new RegExp(mdurl.encode(path.win32.sep), 'g'), path.posix.sep)
|
||||||
.replace(new RegExp(mdurl.encode(path.posix.sep), 'g'), path.sep)
|
.replace(new RegExp(mdurl.encode(path.posix.sep), 'g'), path.posix.sep)
|
||||||
.replace(new RegExp(escapeStringRegexp(path.win32.sep), 'g'), path.sep)
|
.replace(
|
||||||
.replace(new RegExp(escapeStringRegexp(path.posix.sep), 'g'), path.sep)
|
new RegExp(escapeStringRegexp(path.win32.sep), 'g'),
|
||||||
return temp.replace(
|
path.posix.sep
|
||||||
|
)
|
||||||
|
.replace(
|
||||||
|
new RegExp(escapeStringRegexp(path.posix.sep), 'g'),
|
||||||
|
path.posix.sep
|
||||||
|
)
|
||||||
|
.replace(
|
||||||
new RegExp(
|
new RegExp(
|
||||||
STORAGE_FOLDER_PLACEHOLDER +
|
STORAGE_FOLDER_PLACEHOLDER +
|
||||||
'(' +
|
'(' +
|
||||||
|
|||||||
Reference in New Issue
Block a user