tommoor / emojione-picker

A react emoji picker for use with emojione
http://tommoor.github.io/emojione-picker
MIT License
261 stars 61 forks source link

Escape regex metacharcters when constructing search term RegExp from … #52

Closed ahutchings closed 7 years ago

ahutchings commented 7 years ago

…user input

Without escaping, user input such as "[" or "*" trigger an uncaught SyntaxError: "Invalid regular expression: /^(?:. +)[/: Unterminated character class"

tommoor commented 7 years ago

Killing it, btw I just switched to using prettier to auto format the code - does away with opinions which is great on OS projects like this :) Just wanted to let you know incase you do any more PR's master was just linted and updated with that formatting which changed a bunch of files.

ahutchings commented 7 years ago

Nice, I've been meaning to check out prettier. Will definitely update before sending any PR's!