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

Mentions incorrectly matching periods at the end of sentences #133

Open
adammcmaster opened this issue May 8, 2018 · 2 comments
Open

Mentions incorrectly matching periods at the end of sentences #133

adammcmaster opened this issue May 8, 2018 · 2 comments

Comments

@adammcmaster
Copy link
Contributor

I'm not sure if there's a good way to fix this, but in the mentions regex:

https://github.com/zooniverse/Talk-Api/blob/6729cb1b43a279e8209b70a677802db6d141b1cb/app/models/concerns/comment/mentioning.rb#L16

This will also match periods which happen to follow the username but aren't actually part of the username. Report from Talk here.

E.g. if someone says This is a sentence ending with @user.name. it doesn't seem to correctly parse the username. If we fix that, we'd also break mentions for users with trailing periods in their names, but I'd guess that's pretty rare so it's probably the better option.

@marten
Copy link
Contributor

marten commented May 8, 2018

There's nobody with a dot at the end. There are people called . and - though. :(

@camallen
Copy link
Contributor

Noting that modifying the final match regex ( @([\w\-\.]+) ) to match the trailing period yet still capturing the login will make this work. I'll have a look

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

No branches or pull requests

3 participants