I am using jquery-textcomplete autostart in my web application. It works great for English and Russian letters. But it does not work for certain special letters, such as "ҷ" .
The code:
$('.form-control').textcomplete([{
words: ['ҷ', 'ҷҳ', 'english'],
match: /(^|[^\w-ҷ])([\w-]{2,})$/i,
search: function(term, callback) {
callback($.map(this.words, function(word) {
return word.indexOf(term) === 0 ? word : null;
}));
},
index: 2,
replace: function(word) {
return '$1' + word + ' ';
}
}]);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.textcomplete/1.8.4/jquery.textcomplete.min.js"></script>
<textarea class="form-control"></textarea>
Run codeHide resultHere the word 'ҷ'
and 'english'
work, but 'ҷҳ'
do not. How can i fix this?
I need the following letters to work: ғ,ӯ,қ,ҳ,ҷ,ӣ
and -
.
source
share