Schamper / nodebb-plugin-cards

NodeBB plugin that extends the mentions plugin with hover cards
MIT License
9 stars 9 forks source link

Not working when username contains non-latin characters #6

Closed dontpanic92 closed 8 years ago

dontpanic92 commented 8 years ago

When username contains non-latin characters, for example 哈哈哈, the plugin cannot work normally.

I take a look at main.js, and found this line:

if (href && (!utils.invalidLatinChars.test(href[2]) && !utils.invalidUnicodeChars.test(href[2]))) {

https://github.com/Schamper/nodebb-plugin-cards/blob/master/public/js/main.js#L20

Non-latin unicode characters cannot pass the first utils.invalidLatinChars.test(href[2]) test, and so the card won't pop up.

Schamper commented 8 years ago

I remember there being a reason as to why I did this, but I can't remember. I'll try and do some testing when I get time.