joypixels / emojify.js

A Javascript module to convert Emoji keywords to images
http://hassankhan.github.io/emojify.js/
MIT License
1.8k stars 238 forks source link

+1 filename should be sanitized #119

Closed akdotcom closed 9 years ago

akdotcom commented 9 years ago

Emoji names aren't currently being sanitized, leading to the creation of a the +1.png filename and the generation of a .emoji-+1 css rule.

'+' is a reserved character in URLs and in CSS. As far as I know, this isn't breaking anything on the URL side, but it does mean that emojify.css's auto generated CSS rule for +1 isn't working.

hassankhan commented 9 years ago

Yeah I remember this, any ideas on how to get around it? Call it plus1 instead?

akdotcom commented 9 years ago

I'd maybe designate an special character, say _, to indicate that this is a special case and keep it out of the normal namespace? So _plus1 indicates that this is an emoji name requiring special handling. Not sure if it's worth codifying that _plus means + or if it's better to look for the _ prefix and branch accordingly

hassankhan commented 9 years ago

Would you mind checking again on the latest version? Thanks

akdotcom commented 9 years ago

:+1: working!

hassankhan commented 9 years ago

Thanks for reporting back!

akdotcom commented 9 years ago

Thanks for taking a crack at it so quickly! BTW, we're using the library via bower, so eagerly waiting for 1.0.0 to land there =)

hassankhan commented 9 years ago

You should really thank @adam-lynch and @4ver, this was all their work :smile:

PS: I don't understand why Bower isn't updating, everything seems to be in order :confounded:

akdotcom commented 9 years ago

Thanks @adam-lynch & @4ver !!