pvojtechovsky / obsidian-link-with-alias

Obsidian plugin for handy creation of links and alias in front matter of target document
MIT License
36 stars 2 forks source link

[BUG] Link with Alias fails to create defined alias when there are punctuation marks following. #23

Open stoweboyd opened 4 weeks ago

stoweboyd commented 4 weeks ago

Link with Alias fails to create defined alias when there are punctuation marks following.

For example, quite commonly, but not 100% consistently I may type +some topic, select that, and add the alias like +some topic|some topic and execute the create link with alias command. Often, when there is puncuatation following like +some topic|some topic, -- even though the comma is NOT selected -- the alias created is +some topic. I then have to manually edit the note and its alias. And then I return to the note where the reference was created, I have to manually edit [[+some topic|+some topic]] into [[+some topic|some topic]].

pvojtechovsky commented 1 week ago

I never tried to add alias before the create link with alias command is executed, like you do.

Yes there is a bug in this plugin and it behaves strange when you select text like link|alias and then you execute create link with alias command.

Workaround

Use the plugin as expected. It means first write down the text of alias, then run the command create link with alias and then edit the link in order to select the expected link target. That use case is tested and should work for you.

@stoweboyd Does the workaround works for you?