Skip to content

Conversation

hekatonsure
Copy link
Contributor

Problem

Current implementation force-appends .md to all paths, preventing users from opening PDFs, images, or other supported file types.

Solution

Check for existing file extension before defaulting to .md. Simple regex test preserves backward compatibility while enabling broader file support.

Changes

  • Add extension detection via /\.[^.]+$/ regex
  • Only append .md when no extension present
  • Fixed template literal syntax in error notices

Tested with: note.md, note, image.png, doc.pdf

Limitations

Doesn't auto-resolve to existing non-md files when extension omitted. E.g., openNote('myfile') won't find myfile.pdf - still defaults to searching for myfile.md. Full path with extension required for non-markdown files, which may be preferred use pattern.

@Staaaaaaaaaan Staaaaaaaaaan merged commit 7587084 into Staaaaaaaaaan:main Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants