3
I am trying to leave @ as string. Here is the code:
hint: {
mentions: ['Pedro', 'Tiago', 'João', 'Maria'],
match: /\B@(\w*)$/, // Problema com @
search: function (keyword, callback) {
callback($.grep(this.mentions, function (item) {
return item.indexOf(keyword) == 0;
}));
},
content: function (item) {
return '@' + item; // Problema com @
}
},
Marked lines face the problem of @.
The problem is @, it understands as template syntax. How to leave it as string ?