fixed mention regex to respect dots in usernames - #3800
Conversation
mxstbr
left a comment
There was a problem hiding this comment.
Does this tag Hey @mxstbr. as "mxstbr." being the mention? That's what I was trying to avoid with not tagging the dot.
|
Can you try |
mxstbr
left a comment
There was a problem hiding this comment.
Ohh, thank you for adding a test case 👍
One last question: do we need the \b?
|
No it looks like we do not need the |
mxstbr
left a comment
There was a problem hiding this comment.
Okay one last nitpick I swear: can we also add a test case for the original edge case (username with a dot in it) in combination with the trailing period one? 👼
Thank you!!
|
Not a nit pick at all. This is embarrassing 😊. I don't think I've had my recommended dose of coffee yet. The changes to the regex I've introduced allow for other trailing punctuation. I've updated it again to specify allowed characters instead of disallowed. this of course means that |
mxstbr
left a comment
There was a problem hiding this comment.
this of course means that _ - won't be allowed in the mention which I think is a good thing?
I think we want those? Usernames can include - or _!
|
@mxstbr this latest changes still allows them it just doesn't allow them to be the last character of the username. Which I think is normal for usernames, wasn't sure what your rules were though. |
I believe we allow those characters to be the last character of a username |
mxstbr
left a comment
There was a problem hiding this comment.
This LGTM!!!
Sorry for the slow reply @dan-weaver, thanks so much for the contribution 💯




Status
Deploy after merge (delete what needn't be deployed)
Release notes for users (delete if codebase-only change)
.within usernamesRelated issues
tangentially related to #3793 #2649
before this fix:

after this fix:
