anpigon / obsidian-book-search-plugin

Obsidian plugin that automatically creates notes by searching for books

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"{{author}}, {{title}}" for the New File Name will NOT include the comma after the author

ReaderGuy42 opened this issue · comments

In an earlier version of the plugin this was not an issue, but now the comma in the generated file names no longer show up.

Is there a way to fix this?
Thanks!

Hi again, have there been any updates on this? Thanks :)

How about now lol

I am not the owner, this is just my opinion.
This behavior is correct because the comma has been removed to generate a title. Including a comma in a filename is not a good idea as it may cause unexpected errors (possibly only on Windows? I only searched with google).

If you want to modify this, you can fork this repository and modify src/utils/utils.ts:10 as follows:
Before:

export function replaceIllegalFileNameCharactersInString(text: string) {
return text.replace(/[\\,#%&{}/*<>$":@.]/g, '').replace(/\s+/g, ' ');
}

After:

return text.replace(/[\\#%&{}/*<>$":@.]/g, '').replace(/\s+/g, ' ');

and use this as a plugin for yourself.

Thank you.