Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant mention turkish usernames #170

Closed
barisusakli opened this issue Jan 24, 2022 · 2 comments
Closed

cant mention turkish usernames #170

barisusakli opened this issue Jan 24, 2022 · 2 comments
Assignees
Labels

Comments

@barisusakli
Copy link
Collaborator

Create two users
username 1: Muhammed lkan Coskun
username 2: Muhammed İlkan Coşkun

Clicking reply on their posts adds the mention into the post body but username 2 can't be mentioned.

Did some console.log in parse method seems regex doesn't get the complete username for username 2

// post 1
split content [ '<p dir="auto">my first post</p>\n' ]
split content [ '<p dir="auto">@muhammed-lkan-coskun it works</p>\n' ]
matches [ '@muhammed-lkan-coskun' ] // works here

// post 2
split content [ '<p dir="auto">now with turkish characters</p>\n' ]
split content [ '<p dir="auto">@muhammed-i̇lkan-coşkun a mention</p>\n' ]
matches [ '@muhammed-i' ] // seems like doesnt match the whole thing
@barisusakli
Copy link
Collaborator Author

Got the fix from https://github.com/julianlam/nodebb-plugin-mentions/blob/master/static/autofill.js#L59, since selecting these usernames from the autofill dropdown was working, turns out the autofill dropdown is preserving the case so the turkish capital i wasn't converted into a weird character.

@julianlam
Copy link
Owner

👏 for the fix, looked like a tough one to narrow down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants