jlegewie / zotfile

Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.), and extract PDF annotations.
4.05k stars 281 forks source link

Allow invalid characters when renaming #632

Open Nic-Flamel opened 2 years ago

Nic-Flamel commented 2 years ago

Hi

Is it possible to allow “invalid” characters ("?", "/", etc.) in any position of the name of the new file when moving and renaming?

Currently, those characters are replaced by "-" when located in the middle of a title. When one is located at the end, it's omitted when renaming.

I thought just editing the wildcard.js and/or zotfile.js files, which include strings with rules about it, would do the trick (as a trial, I simply deleted the relevant references to the "?" character; then rezipped and reinstalled the add-on), but that didn't work. Curiously, now question marks are completely omitted when renaming, regardless of where they're located within a title (almost the opposite of what I intended, xD!).

I also tried toggle to “false” the “extensions.zotfile.truncate_smart” preference, but didn't note any difference when renaming. BTW, the zotfile's preference "Truncate title after . or ?" is disabled.

I'd appreciate any help to accomplish this.

Greetings.