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

Emojify conflicting with FontAwesome #118

Closed Cederman closed 9 years ago

Cederman commented 9 years ago

Hi! Awesome project! I love it :smile: However, I have noticed some strange behaviour when used on my site. I have a few FontAwesome icons on my page and once every 5th or so reload the FontAwesome icons end up looking like this:

skarmavbild 2015-01-18 kl 22 20 46

Instead of this:

skarmavbild 2015-01-18 kl 22 27 06

And when I run emojify.run(); the issues seems to dissapear. I also tried to rearrange the Emojify and FontAwesome css to load in different orders but it is still the same.

Any clues?

hassankhan commented 9 years ago

I would say you should add no-emojify to your icon classes, but try updating and let me know if it's still an issue

hassankhan commented 9 years ago

If you update, you should be able to provide a blacklist.classes array of classnames you don't want emojified.

hassankhan commented 9 years ago

Any luck?

Cederman commented 9 years ago

Hi, sorry for the delay. I tried to add blacklist.classes and provide an array like this: ['fa'] but it complains about the dot (".") in blacklist.classes. Am I interpreting it wrong?

Cederman commented 9 years ago

Like this:

if($('#comments').length) {
        emojify.setConfig({
            blacklist.classes : ['fa'],
            only_crawl_id    : 'comments',
            img_dir          : '/bower_components/emojify.js/images/emoji',  // Directory for emoji images
        });
        emojify.run();
    }
hassankhan commented 9 years ago

In the source, blacklist is an object, like so:

var defaultConfig = {
    blacklist: {
        'ids': [],
        'classes': ['no-emojify'],
        'elements': ['script', 'textarea', 'a', 'pre', 'code']
    },
    tag_type: null,
    only_crawl_id: null,
    img_dir: 'images/emoji',
    ignore_emoticons: false,
    mode: 'img'
};

Sorry, I'm unable to test right now because I'm at work :smile:

Cederman commented 9 years ago

Ah, I see. I added it now, thanks for the help. I won't be able to test this right away but I'll close this issue. :+1: