0

I often want to give credit in an answer (i.e. a post) to people who have nicknames longer than one word. When I mention the user with "@", how can I make it link to the user profile by Stack Overflow?

4
  • 2
    It autocompletes to the name without spaces anywhere mentions work.
    – davidism
    Commented Feb 27, 2016 at 18:22
  • 3
    Mentions don't link. If you're just asking how to create a link, then you create it with the normal markdown syntax.
    – davidism
    Commented Feb 27, 2016 at 18:24
  • Are you talking about using this in comments, or in posts?
    – jscs
    Commented Feb 27, 2016 at 18:28
  • 1
    @JoshCaswell I was talking about posts Commented Feb 27, 2016 at 18:42

2 Answers 2

3

Remove the spaces.

e.g. to reply to "Long User Name", you'd mention @longusername

See How do comment @replies work? for more details, specifically (emphasis mine):

  • Take the first word immediately following the @, where the word boundary is determined by a space, a character not valid in user names (such as : , / ! ?) or the end of the comment.
  • Remove one trailing dot . from the resulting string if applicable (and if the string has more than two characters).
  • If the remaining string ends in ' or 's, remove that piece from the string.
  • The resulting string will be matched against the user name with spaces removed.
3
  • Thank you for the documented answer. Commented Feb 27, 2016 at 18:41
  • 2
    Note that this only applies to comments, @Billybobbonnet; the "@username" has no special significance in a regular post.
    – jscs
    Commented Feb 27, 2016 at 18:42
  • 2
    Which comment? Mine? I deleted it myself, after @JoshCaswell's clarifying comment. Why leave up incorrect information? I'm happy to be corrected, and wasn't aware that I was part of an argument. Josh had more up-to-date information than I did, he added it, and I removed the inaccurate assertion. That is "teamplay".
    – Paul Roub
    Commented Feb 27, 2016 at 19:32
8

The "@username" form has no special significance in anything other than a comment; it won't be recognized as a "mention" or specially formatted. Paul Roub's answer, which links to How do comment @replies work?, explains how the syntax (specifically, the matching for purposes of pinging) works in comments.

In other cases, if you need to link to a user's profile, you handle it as any other link, using either markdown:

[Josh Caswell's profile][0]

[0]:https://meta.stackoverflow.com/users/603977/josh-caswell

or, if you prefer for some strange reason, HTML:

<a href="https://meta.stackoverflow.com/users/603977/josh-caswell">Josh Caswell's profile</a>

Again, there's no pinging/notification feature on Stack Exchange for "@username" other than in comments, so you should not use the "@" in the context of a regular post.

If you want to cite another user's answer, I would suggest linking to the answer itself, as I did above for Paul Roub's answer to this question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .