sneakyfoxes6k downloadsLint filenames for invalid or troublesome characters.
Lint filenames for invalid or troublesome characters, such as pipes, colons, and brackets.
Useful for Obsidian users who create notes via external means or sync their notes across various platforms.
Handles characters that cause issues for Obsidian itself along with characters that are invalid in Android filenames.
This plugin adds two commands.
Safe filename linter: Lint the current filenameSafe filename linter: Lint all filesnames in the vaultThese commands rename files by replacing invalid or troublesome characters with characters of your choice. The renaming action uses the Obsidian renaming calls and will follow your vault settings for updating internal links (Prompted or Automatic). Be prepared to be patient if you have a large vault with many required renames.
To lint files automatically without needing to manually invoke the commands, enable Lint automatically in the plugin settings. This will automatically lint files created using Obsidian, as well as any files created in external systems that are synced into your Obsidian vault. Enabling the setting will not lint existing files. Run Lint all filenames in the vault once to clean them up.
To the best of our understanding, Lint automatically should also handle files added using Obsidian Sync, but since the authors of this plugin do not use Obsidian Sync, we cannot guarantee compatibility. A contribution validating compatibility would be very welcome.
We are grateful to the developers of Obsidian for the Obsidian Sample Plugin for the basis of this plugin, and to Obsidian Filename Emoji Remover Plugin, whose code we read and experimented with before diving into writing our own plugin.
Thank you to @robertgarrigos and @cwoelk for automatic linting and bugfixes.
Safe Filename Linter in the directory.obsidian/plugins directory and run:
git clone https://github.com/sneakyfoxes/obsidian-safe-filename-lintermain.js and manifest.json in the directory in obsidian-safe-filename-linterWe welcome issues and pull requests for any characters that cause issues for Obsidian or any platform it runs on. We also welcome any additional replacement characters. This plugin has no desire to handle linting characters beyond functional filename use cases.
See CONTRIBUTING for details on how to submit code.