sindresorhus / filenamify

Convert a string to a valid safe filename
MIT License
489 stars 26 forks source link

Prevent stripping of outer replaced characters. #38

Closed orsett0 closed 1 year ago

orsett0 commented 1 year ago

Fixes #11. Just like #12, "now we trim repeat and outer reserved chars before doing a global replace with the replacement char, to preserve instances of that char present in the original string". The only difference is that I think we should maintain as much of the original string as possible, so we don't strip outer reserved characters, we only replace them with the replacement string.

sindresorhus commented 1 year ago

https://github.com/sindresorhus/filenamify/pull/12#issuecomment-586206329