wuyuntao / jquery-autosuggest

A fork of AutoSuggest jQuery plugin writtern by Drew Wilson.
http://github.com/wuyuntao/jquery-autosuggest
118 stars 59 forks source link

Enable autosuggest for words containing parenthesis. #15

Closed christianvuerings closed 12 years ago

christianvuerings commented 12 years ago

When you currently use either "(" or ")" - parenthesis in a word that needs to be autosuggested, it results in an error message in the browser:

unterminated parenthetical

or

unmatched ) in regular expression

These errors occur on the following line:

if(str.search(query) != -1 && values_input.val().search(","+data[num][opts.selectedValuesProp]+",") == -1){ ...

The reason for this is that the parenthesis need to be escaped.