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
Post a Comment