ozntel / obsidian-link-converter

Obsidian Plugin to scan all your links in your vault and convert them to your desired format.
178 stars 16 forks source link

Convert existing Wikilinks from shortest to absolute path #35

Open Brenzle opened 3 months ago

Brenzle commented 3 months ago

What I'm trying to do

Let’s say my Wikilink is [[Math]], while the path to the file is “Semester1/Math”. I want to convert this Wikilink to absolute path format, so that it becomes [[Semester1/Math]], or even [[Semester1/Math|Math]] which is Obsidian’s behavior when using absolute path.

Things I have tried

I first tried converting one Wikilink from shortest to absolute path just to see how the plugin works. The only current line/selection related options I see in command pallete are:

  1. Link Converter: Editor Selection: Links to Wiki
  2. Link Converter: Editor Selection: Links to Markdown

Option 1 doesn’t change the link at all, even tho I selected the absolute path option in plugin settings. The workaround I found is to use option 2 and then option 1, but any link to a note that has parentheses in the name (like "Math (1)") gets destroyed (it becomes [[1)](Math (1|Math (1)]].md) ).

Also, doing the 2-step workaround will convert Markdown links pointing to Youtube videos into invalid Wikilinks, if the alias contains parentheses. Example: What does the Laplace Transform really tell us? A visual explanation (plus applications) - YouTube gets converted into [[plus applications) - YouTube](https://www.youtube.com/watch?v=n2y7n6jw5d0|What does the Laplace Transform really tell us? A visual explanation (plus applications) - YouTube]]

These problems are mentioned in issues 8, 12 and 30.

If this plugin is not maintaned anymore, I'd appreciate a comment from anyone in a similar situation who's found a working solution.