seethroughdev / obsidian-recipe-grabber

MIT License
59 stars 8 forks source link

fix: escape filename characters disallowed on Windows #31

Closed Ovyerus closed 5 months ago

Ovyerus commented 5 months ago

Had an error come up while trying to grab a recipe with quotes in the title (https://www.cookwell.com/recipe/lamb-pita-smash-burger) on my Windows machine.

Error: File name cannot contain any of the following characters: * " \ / < > : | ?

I just added a simple regex to filter out these characters completely, and the problem is now gone. This didn't crop up on MacOS (and maybe Linux? haven't tested) due to it being more lax with file names, but I think it's best to apply this for all platforms so that nothing bizarre happens when syncing between different operating systems.

seethroughdev commented 5 months ago

Yeah, I thought the same thing when i first saw the code. If we get any further complaints we can always include https://github.com/sindresorhus/filenamify