Sanitize filenames for all platforms used with Sync

Use case or problem

Different platforms have different disallowed characters for filenames. Currently, Obsidian Sync fails for any files which contain disallowed characters in the filename. This means that you need to go to the client where the file came from and fix it.

Proposed solution

The list of disallowed characters should be modified to include the characters disallowed on all client platforms. This is probably possible since Obsidian Sync presumably knows the platforms of all of my clients. Additionally, it should offer to sanitize the filenames in the following situations:

  • Sync is enabled
  • A new client platform is added

This way the vault will always be in a good state for sync.

Current workaround (optional)

  • Manually remove problematic characters from filenames
  • Manually run the Safe Filename Linter plugin occasionally

Related feature requests (optional)

None that I could find

2 Likes

+1 on this.

Obsidian is pretty awesome, and it is frustrating to see this, I’ll use the word “rookie” mistake go unnonticed and untackled.

Filenames should not contain empty spaces, should be all lower caps, and English alphabet letters.

Even cyrilic alphabets can be transliterated automatically.

Duplicate filenames from stuff like “skola.md”, “škola.md”, “школа.md”, “Skola.md” - and similar can be fixed by adding a number at the end (WordPress automates this wonderfully with post URIs).

If there is fear of backwards compatibility, perhaps this can be set as a “core plugin” - letting the users enable it if they wish.

Problems I can see: first adoption, resolving stuff once the sanitization is enabled.

I think this is a must, and well worth it in the long run. May be missing something, but that’s my impression.

Relja

1 Like