net-set icon indicating copy to clipboard operation
net-set copied to clipboard

replace username spaces with hyphen

Open mschmo opened this issue 9 years ago • 1 comments

This fixes jQuery selector unrecognized expression errors and empty ID selector results caused when a username has spaces.

Since username is used for ID selectors, it should be formatted properly. Google recommends hyphens: https://google.github.io/styleguide/htmlcssguide.xml#ID_and_Class_Name_Delimiters

mschmo avatar Oct 16 '16 16:10 mschmo

Although I guess this also opens the door to a whole bunch of design questions:

  1. What about other characters that should be escaped? " for example in a username would break things.
  2. Should there be character restrictions on usernames?
  3. Maybe make 2 versions of usernames? One that is user friendly and one HTML attribute friendly.
  4. Should players have IDs? Then attributes could be something like player-<id> keeping things uniform.

4 on that list is an important one. Just made me realize as I was typing it that a player could have the username sidebar which would create an HTML ID conflict. Definitely should consider a uniform alternative to the naming convention to prevent something like that from happening.

mschmo avatar Oct 16 '16 17:10 mschmo