daledesilva / obsidian_ink

Other
365 stars 9 forks source link

Custom File Organization Validation #64

Open jaketae opened 1 month ago

jaketae commented 1 month ago

Describe the bug

When using the "Custom File Organization" option in the settings, Obsidian Ink can silently fail if the user inputs an invalid directory. In my case, I tried using .ink/drawing and .ink/writing because I wanted to "hide" the folders, not knowing that creating a directory with a dot prefix (.blah) is not allowed in Obsidian.

To Reproduce

  1. Go to "Custom File Organization" in the plugin settings.
  2. Edit the default Ink/... path to .ink/....
  3. Go into any note and create a handwriting section.
  4. The section is not created, and there is no feedback to the user; it silently fails.

Expected behavior

We should validate the user input and notify them if the path is not allowed by Obsidian.

Desktop (please complete the following information):

Additional context

This is a weird edge case, but a bug nonetheless. Also thanks for this awesome plugin! This gives me greater confidence that I can move everything to Obsidian, both for typed and handwritten notes.

daledesilva commented 1 month ago

Thank you for the bug report! I had known I needed to sanitize it but completely forgot.

I'll sanitize it first as a first step (so it doesn't fail), and probably show an alert in the future.