Repository navigation
fix: update %20-encoded markdown links when moving notes - #143
Open
jayhemnani9910 wants to merge 1 commit into
Open
jayhemnani9910 wants to merge 1 commit into
jayhemnani9910 wants to merge 1 commit into
Conversation
Obsidian writes markdown links to notes with spaces as [text](folder/My%20Note.md). move only matched the raw path, so those links kept pointing at the old file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
moveupdates[text](folder/note.md)links since #58, but not the form Obsidian writes for a note whose name has a space:[text](folder/Two%20Words.md). Those links keep pointing at the old file, andmovereports success.GenerateLinkReplacementsnow also adds the%20forms of the.mdmarkdown link patterns (plain and./) when the old path has a space.Motivation and Context
Obsidian encodes spaces as
%20in markdown links (its "Internal links" help shows[Three laws of motion](Three%20laws%20of%20motion.md)). With "Use [[Wikilinks]]" off, every move or rename of such a note from the CLI breaks the links to it.Checklist:
Added a "Note name with spaces" case to
TestGenerateLinkReplacements; it fails without the change.go test ./...passes. Ran the steps above with a built binary on a scratch vault: both%20links (plain and./) are updated, the wikilink still is.