When following a local link, instead of opening foo.md if foo.md exists, open foo.md if foo doesn't exist.
I'm using glob instead of filereadable to allow matching directories, and path:sub(-3) ~= ".md" is there to prevent duplicate extensions (ex. foo.md being opened as foo.md.md).
When following a local link, instead of opening
foo.md
iffoo.md
exists, openfoo.md
iffoo
doesn't exist.I'm using
glob
instead offilereadable
to allow matching directories, andpath:sub(-3) ~= ".md"
is there to prevent duplicate extensions (ex.foo.md
being opened asfoo.md.md
).