webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
451 stars 80 forks source link

fix: ensure regex reserved characters are escaped #186

Closed louisbourque closed 4 years ago

louisbourque commented 4 years ago

fixes #185

This pull request will escape each character of the trigger as needed. This will ensure triggers like "((" are properly escaped, preventing invalid regex. It will also avoid escaping non-reserved characters, such as 's' which was preventing the use of some characters as triggers.

jukben commented 4 years ago

Hey! Thank you so much for your PR!

Here is the playground for this revision 🚀

I hope everything is fine! ❤️

This message has been generated automagically

louisbourque commented 4 years ago

@jukben sorry about that, I don't have much experience with Jest. Should be good to go now.

Thanks for the opportunity to contribute! Your library is very useful.