jakiestfu / Mention.js

Lightweight wrapper for adding @user mention functionality to Twitter Bootstraps Typeahead plugin
http://jakiestfu.github.com/Mention.js/
MIT License
750 stars 144 forks source link

Does not work properly with international characters #20

Open koliber opened 10 years ago

koliber commented 10 years ago

I have the following users values:

                         { 
                            username: "AniSales",
                            name: "Ani Sales"
                        }, { 
                            username: "BonnięSales",
                            name: "Bonnię Sales"
                        },

If I type @AniSales all works well and the auto-complete finishes. I I type @Bonn the autocomplete starts, but if I hit enter it does not finish.

I have had this problem with various Polish characters in the username.

snoywing commented 9 years ago

usernames = (this.query.toLowerCase()).match(new RegExp(settings.delimiter + '[\w\W]+', "g")),

line 51, change match rule to this, maybe it will help you