diff --git a/plugs/index/refactor.ts b/plugs/index/refactor.ts index 6a17d1ef..8e1fda32 100644 --- a/plugs/index/refactor.ts +++ b/plugs/index/refactor.ts @@ -103,14 +103,25 @@ async function renamePage( // Replace all links found in place following the patterns [[Page]] and [[Page@pos]] as well as [[Page$anchor]] const newText = text.replaceAll(`[[${oldName}]]`, () => { + // Plain link format updatedReferences++; return `[[${newName}]]`; + }).replaceAll(`[[${oldName}|`, () => { + // Aliased link format + updatedReferences++; + return `[[${newName}|`; }).replaceAll(`[[${oldName}@`, () => { + // Link with position format updatedReferences++; return `[[${newName}@`; }).replaceAll(`[[${oldName}$`, () => { + // Link with anchor format updatedReferences++; return `[[${newName}$`; + }).replaceAll(`[[${oldName}#`, () => { + // Link with header format + updatedReferences++; + return `[[${newName}#`; }); if (text !== newText) { console.log("Changes made, saving..."); diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index e2865891..9c3dd255 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -17,6 +17,8 @@ _The changes below are not yet released “properly.” To try them out early, c * Bug fixes: * Improved Ctrl/Cmd-click (to open links in a new window) behavior: now actually follow `@pos` and `$anchor` links. * Right-clicking links now opens the browser's native context menu again + * `tags` in [[Frontmatter]] are now properly indexed again when listed as an array + * Page links with aliases are now properly renamed * Internal changes: * Big refactor: of navigation and browser history, fixed some {[Page: Rename]} bugs along the way * Plugs now can no longer define their own markdown syntax, migrated all plug-specific syntax into the main parser. This should remove a bunch of editor “flashing” especially during sync.