-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't follow file links, which have %20 to indicate spaces #20
Comments
I got spaces to work with the following. It relies on CommonMark specification. See this question. For example,
I made the following change to the @jghauser do you think this could be incorporated into the plugin? local function resolve_link(link)
local link_type
local link2
if link:sub(1, 1) == [[/]] then
link_type = "local"
link2 = link
elseif link:sub(1, 1) == [[~]] then
link_type = "local"
link2 = os.getenv("HOME") .. [[/]] .. link:sub(2)
elseif link:sub(1, 8) == [[https://]] or link:sub(1, 7) == [[http://]] then
link_type = "web"
link2 = link
else
link_type = "local"
local linki = link:match("^<(.+)>$")
if not linki then
linki = link
end
link2 = fn.expand("%:p:h") .. [[/]] .. linki
end
return link2, link_type
end |
Is this solved by #19 ? Is there some use case for using |
@jghauser No it is not. Still, if I have a file ./files/ansible notes.md, neovim doesn't record it as a link. It's not yellow highlighted as links usually are. |
Unfortunately, this isn't possible in the commonmark markdown specification (that the markdown treesitter parser implements). As the link in the above comment says, you should be able to have filenames with blanks as long as you wrap them in |
@jghauser It does create the file(using lspsaga code actions), but for some reason, pressing enter over the link doesn't take me to the file. Although when on github, the link does work, (it adds that %20 in place of space.), but not locally. How I thought of it was, I press enter on the file, and it takes me to the file, doesn't matter whether the file exists or not (in the not case, it creates the file), or whether there is a space or not (for space the special syntax is exceptable, but it should take me to the file on pressing enter. The creation part has been solved by lspsaga codeactions. |
So if a file name is Docker and Kubernetes.md, then it doesn't follow it.
This is a valid link, but it doesn't work. I create these files using nvim-tree, and would be great to be able to navigate
through these files as well.
The text was updated successfully, but these errors were encountered: