DefactoSoftware / Hours

Time registration that doesn't suck
https://happyhours.io
MIT License
1.04k stars 269 forks source link

Tags break on dashes (and spaces, duh) #301

Open ducpho opened 9 years ago

ducpho commented 9 years ago

Given: logged in, on projects page, entering a new entry When: entering tags in the description that contain a dash Then: the tag is only highlighted until the dash Expected: the whole tag to be highlighted

Also on defacto we somehow got tags with spaces. No idea how they got in. But it looks broken if you use them. Since the whole tag is suggested by autocomplete but only the first syllable gets highlighted if you inserted them.

mischaboldy commented 9 years ago

I've been looking into this and i'm wondering what the best fix is. The problem is that hash tags in general don't allow punctuation which is why they are cut short by dashes, while descriptions do allow punctuation. The easiest solution would be to disallow punctuation in both, but i'm not sure that is the best solution. Any suggestions?

ducpho commented 9 years ago

Just don't allow punctuation in hashtags. So the storing of tags should follow the same rules as the highlighting. That is break at any punctuation or space. In that way it will be understandable to the users and correct usage will follow accordingly.

When fixing this a migration should be added that removes all punctuation and spaces from tags currently stored.

noordean commented 6 years ago

Has this been fixed already?