lenalebt / obsidian-pocketbook-cloud-highlight-importer

Imports highlights and notes from books stored in the pocketbook cloud to your obsidian vault
GNU Affero General Public License v3.0
11 stars 5 forks source link

Allow cyrillic letters in book names #4

Closed anareaty closed 1 year ago

anareaty commented 1 year ago

Right now if the book name is in cyrillic alphabet, book folder is created with an empty name. It can be easily fixed, you just need replace this line:

const sanitized_book_title = book.title.replace(/[^a-zA-Z0-9 -]/g, "");

with this:

const sanitized_book_title = book.title.replace(/[^a-zA-Zа-яА-ЯёЁ0-9 -]/g, "");

It would probably be useful to add some other alphabets symbols too.

lenalebt commented 1 year ago

Probably the same as in #3 . I'll have a look :-)

lenalebt commented 1 year ago

Should be working in 0.1.6 now, I switched from an allowlist of characters to a blocklist, which should address my fear of using disallowed characters for some file systems :-). Feel free to reopen if the issue persists somehow.