scambier / obsidian-no-dupe-leaves

Automatically switch the focus to open notes instead of reopening them
GNU Affero General Public License v3.0
59 stars 5 forks source link

Does not work if the link is to either a heading or to a block in a note #6

Closed romanab closed 1 year ago

romanab commented 1 year ago

It does work for simple links but not for links with a suffix ie. '#' (link to heading) or '#^' (link to block).

I don't know ts but looking at the code I'm guessing it's using the whole link to search for a pane with that name +".md"? If so, you'd need to sanitize the link for the case where there's a suffix before searching.

Then, if the api has a function to jump to the location of the header or block in the open file, call it. Otherwise just switch to the file.

scambier commented 1 year ago

This should be fixed, but this is done with 2 distinct actions: opening the file, then scrolling to the corresponding heading/block. It has the unfortunate side-effect of not triggering the heading/block highlighting that is done by Obsidian 🤷‍♂️