Replace forbidden symbols in filename with user specified character

I name notes the name of the text which may have special characters in. I don’t care to preserve them, so I replace them with a dash manually. Would be nice if this was done automatically with a little toast/flash message that notifies the user that the file name is invalid.

6 Likes

Would be better if the special characters could be in preserved somehow. Mark them automatically in the filename, but then read them in so the special character is in the tag. Would make it much easier to e.g. use a scientific papers title as a a tag, and ensure that you find it again in the future.

I would follow the web standard. %## for whatever is the illegal character. Make it an auto-swap.

2 Likes

Changing a note name by pasting from clipboard; there is a “:” in the clipboard. Current behavior is to flash a red warning and then revert to earlier note name; would prefer if there were an option to similar delete any forbidden characters (perhaps with a warning) and use what remains.

6 Likes

I’d like to slightly modify this: there should be an option to replace a forbidden character with another. For example, replace any forbidden character in a title with “-”.

I’ve been using Obsidian to take notes for a research topic and I’ve been putting the article title as the title/filename of my notes. Many articles have unacceptable characters in them ( : ) is a common one.

If I hit return, the title/filename reverts to untitled. It makes it difficult to edit. (Repaste, then try to edit it, or paste somewhere else, edit, recopy, repaste…) I’m wishing there was an option to auto remove or replace invalid characters.

(Ultimately, I’m not concerned if those characters are there in the title/filename or not, but needing to edit/fix the filename each time is a little annoying.)

8 Likes

Somewhat related:

1 Like

I like this request. I think Obsidian should replace illegal characters in the title with a space or maybe a user-defined character.

2 Likes

I particularly like to use ‘:’ in my titles so would +1 in support of this

Adding my +1 for this. I’m in the process of importing a lot of PDFs into my vault and looking to copy the titles into the filename, but I’m having to manually change “:” to “-” and it’s quite tedious.

I’d vote for a user-defined character as replacement (with the option of leaving it empty so Obsidian would simply leave out illegal characters).

Reason being: I run into this most often with colons (":"). On Linux, this is a perfectly legal character in file names, albeit not in MacOS and Windows. So, many years ago, I got into the habit of using an underscore instead, to symbolize “here is something”. (For multibyte systems like UTF-8: on a character basis, not based on bytes.)