Closed Mideks closed 8 months ago
Your approach handles these local files but then fails to recognize images that were embedded via the Obsidian Syntax (i.e. ![[image.jpg]]).
These image get a path ending with a query parameter e.g. app://4de8acc508e45a4cd7f12451e76d83dbb293/C:/.../image.png?1754515
Your regex includes the query part so the function would return image.png?1754515
. This can then not be matched in the file as the query part is appended by obsidian.
I will add a commit with a new Regex that (hopefully) covers all cases. I think we can safely disregard the handling of query parameters for local files as ?
is not allowed in filenames.
Hmm, really missed that way of attaching files when I was testing. And I was thinking "why would a file path even have a construct with arguments...?". Turns out that's why :) Actually, I was thinking about a similar one to your regular expression, but decided to cut it down for unnecessary, huh
I think it's fix for #35 Now all of those links are correct: C:...\image.png C:...\image.png? C:...\image.png?123 file:\C:...\image.png file:\C:...\image.png? file:\C:...\image.png?123