@Moritz-Friedrich, in both cases, the username is normalised down to a format that is easily parsable, and url valid.
So both "John Frikkin Doe" and "John.Frikkin.Doe" have their slug as "john-frikkin-doe".
Because of this slug collision, we heavily enforce that no two users can have the same slug, as a username:userslug mapping should go both ways.
I will admit that it is not readily intuitive to use dashes to reference a username with spaces, but this is a compromise, because otherwise it would be computationally exhaustive to search for mentions in post content.
This is post content with a mention for @john-frikkin-doe how are you today?
It is quite easy to match the mention here. I search for @ followed by letters and dashes. In reality it is a bit more complicated due to internationalization issues, but I digress...
This is post content with a mention for @John Frikkin Doe how are you today?
This is bad because a possible match would be practically anything after the
So I'd have to make multiple hits against the database to check if the following users exist:
- John Frikkin
- John Frikkin Doe
- John Frikkin Doe how
- John Frikkin Doe how are
- John Frikkin Doe how are you
- John Frikkin Doe how are you today
See the problem?