You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In markdown, a link that spreads across multiple lines is still considered a valid link. For example, this is a valid markdown link:
I use hard wrapping at 80 characters so if at this point I include [a
link](NonExistentPage) here that spans two lines, `wiki.vim` won't find it.
wiki#link#get_all loops through lines so in the above case it wouldn't find the link with any existing matcher. On an individual basis, I can currently 'fix' these links when I find them but they sometimes get recreated by the auto-wrapping I use in vim.
Minimal working example
Add the above copy to any page and then run WikiGraphCheckLinks. It will not find the broken reference to NonExistentPage.
The text was updated successfully, but these errors were encountered:
nickwynja
changed the title
Markdown links broken across lines not matched by wiki#link#get_all
Markdown links spanning across lines not matched by wiki#link#get_all
Apr 28, 2021
Thanks for opening this issue. I agree that this is a valid issue and I will work on it. But please note, this is a bit complex. For instance. the link "handler", which is used to recognize links for link actions (opening and toggling), is not coupled with the link parser used by :WikiGraphCheckLinks. Thus, if I solve the issue so that the standard link actions work, then it still remains to fix it for the graph parser. As you already noticed, the graph parser uses wiki#link#get_all, which loops through lines - it uses regexes that matches on a line at a time, whereas the wiki#link#get uses buffer search which is not limited in the same manner.
The best would be if I could find a way to couple these things so that #get_all uses the same mechanism, but I'm not sure how easy this is. So my first thought is to do this in two steps:
Allow multi-line links for wiki#link#get and wiki#link#open (and related functions).
Description
In markdown, a link that spreads across multiple lines is still considered a valid link. For example, this is a valid markdown link:
wiki#link#get_all
loops through lines so in the above case it wouldn't find the link with any existing matcher. On an individual basis, I can currently 'fix' these links when I find them but they sometimes get recreated by the auto-wrapping I use in vim.Minimal working example
Add the above copy to any page and then run
WikiGraphCheckLinks
. It will not find the broken reference to NonExistentPage.The text was updated successfully, but these errors were encountered: