File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ async function renamePage(oldName: string, newName: string) {
220220 let newTail = text . substring ( link . pos ) ;
221221
222222 // Only relative links need to be updated
223- if ( / ^ [ ^ / ] [ ^ \] ] + ? (?< ! ] ] ) \) / . test ( newTail ) ) {
223+ if ( text . substring ( link . pos - 2 , link . pos ) !== "[[" ) {
224224 newLink = absoluteToRelativePath ( newName , newLink ) ;
225225 newTail = newTail . replace ( / ^ .* ?(? = @ \d * | # | \$ | \) ) / , newLink ) ;
226226 // Wrap in <> if link has spaces
@@ -448,7 +448,7 @@ async function updateBacklinks(
448448 for ( const link of linksInPage ) {
449449 let newTail = text . substring ( link . pos ) ;
450450 let newLink = newName ;
451- if ( / ^ [ ^ \] ] + ? (?< ! ] ] ) \) / . test ( newTail ) ) {
451+ if ( text . substring ( link . pos - 2 , link . pos ) !== "[[" ) {
452452 // Is [Markdown link]()
453453 if ( newTail . startsWith ( "/" ) || newTail . startsWith ( "</" ) ) {
454454 // Is absolute mdlink, update with full path with leading /
You can’t perform that action at this time.
0 commit comments