Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] remove illegal charaters from a file name #98

Open
srustamo opened this issue Jun 21, 2024 · 6 comments
Open

[FR] remove illegal charaters from a file name #98

srustamo opened this issue Jun 21, 2024 · 6 comments

Comments

@srustamo
Copy link

Feature Description

I use Obsidian for note-taking in my research.

To keep things organized, I name each note file after the article it's based on. However, many article titles contain characters like colons (:) or pipes or sqare brackets or hash signs, that aren't allowed in filenames.

When I press Enter after pasting the title, Obsidian automatically changes it to "untitled". This makes editing difficult, as I have to either repaste the title and edit it again, or paste it elsewhere, fix it, and then paste it back. It would be great if Obsidian could automatically remove or replace these invalid characters, so I don't have to manually fix them every time.

Ultimately, whether these characters are present in the file name or not is not a major concern for me. The main issue is the inconvenience of having to repeatedly edit the filename.

Example

Input:

#Ц5  #2комнатная  2/3/4 [кирпич] 

Result:

Ц5  2комнатная  2 3 4 кирпич    
@Benature
Copy link
Owner

Benature commented Jun 29, 2024

For your case, modifying file name is not considered to be supported for now.

As a workaround, you can follow the steps (which is troublesome though)

  1. paste the title text in the file content
  2. Format the text with command Custom Replacement
  3. copy the result text
  4. paste in the tile

Custom Replacement:

  • search: [\*\[\]#] (add other character as you need, I assume you know to write regex)
  • replace: ``

@codey-badger
Copy link

Hi @srustamo , did you find a better workaround?

@srustamo
Copy link
Author

@codey-badger look for file rename plugin în Obsidian community plugins.

@codey-badger
Copy link

@srustamo it doesn't show in my search :(
Screenshot_20240814-005532_Obsidian
Kept looking and there's this safe filename linter but requires manual invocation so it's not suitable for me as I sometimes write a note on the go with 'illegal' characters.

@srustamo
Copy link
Author

@codey-badger, sorry, my earlier response got removed somehow.

https://github.com/rcsaquino/obsidian-auto-filename

@codey-badger
Copy link

@srustamo no problem, I'll check the plugin soon, thanks.

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

No branches or pull requests

3 participants