Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure additional invalid characters #57

Open
Chaphasilor opened this issue Apr 7, 2020 · 2 comments
Open

Configure additional invalid characters #57

Chaphasilor opened this issue Apr 7, 2020 · 2 comments

Comments

@Chaphasilor
Copy link

Chaphasilor commented Apr 7, 2020

Hi, I'm using the module for sanitizing file names for downloaded video files, and process those files later on using FFmpeg. The problem is, your module deems a ' as safe, but it will cause an error if used with FFmpeg.
There might be workarounds for that, or I could manually remove '-characters, but I'd prefer if you could offer us the option to specify our own reserved characters, either in addition to the existing ones or as a replacement to them.

For example, have and option to call sanitize.(<input>, {invalid: ["'"], replacement: "_"} and have it replace everything it already replaces, but also '.

This shouldn't be too much work but I think it would be very useful!

@parshap
Copy link
Owner

parshap commented Apr 7, 2020

Somewhat related: #11

Your suggestion makes sense. I'd be happy to accept a PR that implements this.

@Chaphasilor
Copy link
Author

Hah, I thought you'd say this :D

I'll see what I can do...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants