summernote - Curly brackets in array values, Javascript -


i'm having problems getting autocomplete function work when array values begin , end curly brackets.

say have array values this:

var hints = ["{{ticket_id}}","{{requestor_id}}","{{date_created}}"] 

here's js:

<script>     $(document).ready(function() {         $("#editor_subject").summernote({             toolbar: [],             hint: {                words: hints,                match: /\b(\w{1,})$/,                search: function (keyword, callback) {                  callback($.grep(this.words, function (item) {                    return item.indexof(keyword) === 0;                  }));                }              }                         });     }); </script>  

so way should work, if type {{ti should autocomplete , fill in rest of word {{ticket_id}}, it's not working. if remove curly brackets values in array, works fine.

how can accomplish this? i'm assuming regexp used in match section.

thanks,

this regex ended working me:

/(.{1,})$/

the 2 mentioned above did not.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -