czottmann / obsidian-actions-uri

A plugin for Obsidian (https://obsidian.md) that adds additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.
https://zottmann.dev/obsidian-actions-uri/
MIT License
138 stars 6 forks source link

[ZCO-138] Support non-notes extensions in file path existence checks #74

Closed czottmann closed 1 year ago

czottmann commented 1 year ago

Currently, when the the route requires an existing file path, and the sender passes a file parameter without the extension .md, the extension is added prior to the check. For existing non-notes files like canvasses (.canvas) this is a problem, because even if the full file path was passed-in, the superfluous extension is added and the check will fail, e.g. Project.canvas becomes Project.canvas.md.

Fix this by not just checking for \.md$ but against an array of allowed extensions, and only if neither of them was used, add .md.

ZCO-138