-
Hi, MacOs offers application specific url to information/documents that are managed by some specific application. For exampl I use DEVONthink to manage and store documents. The URL of a document looks like this My configuration of obsidean.nvim contais this function follow_url_func = function(url)
-- vim.ui.open(url, { cmd = { "open" } }) the default implementation does not work either
vim.fn.jobstart({ "open", url }) -- Mac OS
end, So in theory obsidean.nvim should also open the attachment in DEVONthink. But instead I receive this error message Is this a general problem, i.e. can obsidean.nvim only links to files or websites? Or do I have to add something to my confinguration? Ciao Maral |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, in theory the default Let's add some print debugging, just print |
Beta Was this translation helpful? Give feedback.
-
Hi, i added a print call two my function: follow_url_func = function(url)
print("URL: " .. url)
vim.ui.open(url, { cmd = { "open" } })
-- vim.fn.jobstart({"xdg-open", url}) -- linux
end I hope that was the correct way. But I never saw any output. I analyzed the code of if res.url ~= nil then
Obsidian.opts.follow_url_func(res.url)
return
end Since it is not called NakedUrl = "https?://[a-zA-Z0-9._-@]+[a-zA-Z0-9._#/=&?:+%%-@]+[a-zA-Z0-9/]", -- https://xyz.com
FileUrl = "file:/[/{2}]?.*", -- file:///
MailtoUrl = "mailto:.*", -- mailto:emailaddress One could consider this as a bug. One solution could be to add an optional list of protocols that can be handled by the user defined function Ciao MaralWa |
Beta Was this translation helpful? Give feedback.
I see! Thank you for your insight, I have listed this one improvement in #189, so that we can track it there. I will close this one for now.
Also your solution sounds great, we can just add an
opts.open.protocols
, and have a list of protocols like you mentioned, since you got this far, would you like to do a PR?