follow-md-links.nvim icon indicating copy to clipboard operation
follow-md-links.nvim copied to clipboard

Filenames with whitespace support

Open tvanyo opened this issue 1 year ago • 1 comments

To address issues #3 and #18, I've made a change to allow whitespace in path or filenames in reference links.

To achieve this, the links with whitspace need to be wrapped in < >. For example:

[ref link 1][1]
[ref link 2][2]

[1]: ./file_without_space.md
[2]. <./file with space.md>

The link ./file_without_space.md should also be written as <./file_without_space.md> without an issue. The PR strips the <> after the iter_match call, which seems to be the source of the problem.

tvanyo avatar Dec 08 '23 05:12 tvanyo

It turns out that the angle bracket is required to allow whitespace. This is because treesitter-markdown supports the GitHub Flavored Markdown and, per example 164 of the GFM spec, spaces in link destinations require the angle bracket.

So this is the valid, not kludged, fix for this issue.

tvanyo avatar Dec 08 '23 17:12 tvanyo

Thank you! And sorry this has taken me forever to get to! <3

jghauser avatar Feb 11 '24 18:02 jghauser