Open Markdown linked file in Devonthink

Hi all,

I’ve been reading through many forum posts and non seem to deal with my specific question, so here goes. Apologies if I missed something

I’ve tested some methods of linking from one Markdown file to another and found the following results:

1. [test link](anotherfile)
2. [test link](anotherfile.md) - works!
3. [test link](/anotherfile)
4. [test link](/anotherfile.md)
5. [test link](./anotherfile)
6. [test link](./anotherfile.md) - works!

BUT! Here’s the catch, when clicking on the links created by either of the 2 working options above, the linked file opens in Typora instead of Devonthink. Is there anyway to have Devonthink open this document in another tab instead of Typora?

PS. Both files are located in the same group :slight_smile:

[test link](anotherfile.md)

This should work when the linked document is in the same group.

[test link](/anotherfile.md)

This should work when the linked document is in the root of the database.

[test link](./anotherfile.md)

Please verify this link actually works. It shouldn’t.

Hi Bluefrog,

Thanks so much for the swift response!

  1. works as you describe
  2. I can’t get this one to co-operate
  3. Yup it works

Regarding my original question - is there a way to have these files open in Devonthink? at the moment they open externally in Typora!

Screenshot

2. I can’t get this one to co-operate

That’s because the file isn’t in the root of the database.

[test link](./anotherfile.md)

This is actually not working and is unsupported. The dot would signify it’s gone up a level to a parent group. However your file is in the same group so it’s not acting correctly. @cgrunenberg would have to look into this.

is there a way to have these files open in Devonthink? at the moment they open externally in Typora!

I’m not seeing any issue here when I click the link in the document. It just switches to the linked document. A screencast could be helpful.

if you have a look in my screenshot, I tried this out with another link to a file called “yetanotherfile.md” which is in the root, but doesn’t seem to work - or am I missing something? I’ll send a screencast shortly :slight_smile:

Hope this helps:

Screen Recording 720.mov.zip (9.5 MB)

Quit and relaunch DEVONthink.
Does the issue persist?

Yup, I also tried on 2 different macs, but no difference. I also tried setting the default app for .md files to Devonthink and that didn’t help either.

What operating system are you using?

One Mac on Catalina 10.15.4 and the other Mojave 10.14.6

something else very strange that I just discovered, links don’t work if there are spaces within the file name. So based on my tests none of the following work given the file name: 12345 this is a test.md

1. [test link](12345 this is a test.md)
2. [test link](12345_this_is_a_test.md)
3. [test link](“12345 this is a test.md”)
4. [test link](./12345 this is a test.md)

Sooooo… I’ve been doing some more tests, and semed to have found the culprit for the root file and opening within DevonThink issues - Indexed files and folders! Both of these issues were resolved when I tested on files that weren’t indexed!

If the folders are indexed the files are opened in an external editor and the root link doesn’t work. Is this a bug? or the intention?

Doesn’t work in either indexed or non-indexed situations

Spaces have to be percent encoded to %20.

[test link](./anotherfile.md)

This is actually not working and is unsupported. The dot would signify it’s gone up a level to a parent group.

Is DT using some non-standard path notation? “.” is the present directory for POSIX paths. The parent group would be “…” [that’s two dots, but your forum is rendering it as three]. I can verify in the terminal that macOS recognizes “./file.txt” as referring to “file.txt” in the current directory.

Is this different behavior intentional?

No. That was an oversight on my part. It’s meant to read ../anotherfile.md.

Sorry I meant about the different behaviors for indexed files vs non-indexed

I’m having the same issue in regards to links in markdown files in an indexed group only opening the files in the external application (as defined in the Finder Info panel).

In a non-indexed group, if I create a link to another file (i.e: [Another File](another_file.md)), clicking on it in preview mode will show me another_file.md. In an Indexed Group, clicking on the same link (assuming there is also a file in the group called “another_file.md”), will open the file up in TextEdit (or whatever application I have set to handle “.md” files).

Changing the file handler to Devonthink 3 just prevents anything at all from happening when I click on the link.

EDIT: Setting the handler to Devonthink 3 imports the file into the Devonthink 3 – in my case it drops a copy of the file into the global inbox, just as it does if I were to double click on the file from the Finder.

Welcome @pgillan

This is likely due to a regression in the 3.5 release. An adujstment has been made for the next maintenance release and I am not seeing that behavior here. Thanks for your patience and understanding.

This is likely due to a regression in the 3.5 release. An adujstment has been made for the next maintenance release and I am not seeing that behavior here.

These links are still being opened in external applications after upgrading to 3.5.1.