Problem with internal links

Hello,
perhaps I am doing something wrong… But I don’t know how to do internal links in one org-roam document. According to https://orgmode.org/manual/Internal-Links.html and as far as I understand:

  • I set “#+name: fig:new-image” for one image.
  • I create the link “[[fig:new-image]]”
  • When I click on the link, instead of moving to the image location inside the file, the “org-roam-capture” function is called.

Am I doing anything wrong?

Regards,

1 Like

I can confirm this behaviour. Internal links to named locations, e.g. figures, tables, source code blocks with #+name: header, do not work. It is a bug. Please check if it has already been reported. Otherwise you can report it yourself.

1 Like

Radio targets are also bugged.

1 Like

Org-roam replaces fuzzy link behaviour entirely. I’ll add a switch to turn it off.

I wonder if a better solution is to somehow wrap orgs default handling of them? e.g. On a fuzzy link first let org check if there is an appropriate target (a #+name or a radio target etc.), if there isn’t a valid org link target org roam handles the link.

You could then maybe have an option with three settings

  • Only have org handle fuzzy links
  • Only have org roam handle fuzzy links
  • Have org search for targets, then org roam search for targets

I haven’t dug into the internals of how org handles fuzzy links so I’m not sure how feasible this is

1 Like

Hello,

I created the bug report https://github.com/org-roam/org-roam/issues/1098

Feel free to add your comments and suggestions. Regards!

1 Like

That was also the first thing that came into my mind. A switch option, perhaps with an interactive toggle command, is easier to implement quickly.

From my preliminary investigation it’s not easy to wrap the behaviour of Org here. Org calls hooks in org-open-link-functions early with the string path, instead of the full link. Without knowing the type of the link (radio, fuzzy etc.) I cannot replicate Org’s behaviour.

1 Like