The current implementation assumes unix/mac / path separators, which neatly maps to URLs. However when running on Windows as the path separators are \ each the items will not be added to the shortlisted hrefs due to index.js:122:
if(href[i-1]=='/')
shortlists.push(href);
Which results in no pages being found when resolving Obsidian style [[internal-links]].
This change swaps out path.sep characters with / when converting the file path to a href to allow the shortlisted href check to pass as expected. It also uses path.join & path.sep to attempt to keep Windows behaviour consistent with other OS path handling.
The current implementation assumes unix/mac
/
path separators, which neatly maps to URLs. However when running on Windows as the path separators are\
each the items will not be added to the shortlisted hrefs due to index.js:122:Which results in no pages being found when resolving Obsidian style
[[internal-links]]
.This change swaps out
path.sep
characters with/
when converting the file path to a href to allow the shortlisted href check to pass as expected. It also usespath.join
&path.sep
to attempt to keep Windows behaviour consistent with other OS path handling.