Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure to add <span> around emoji? #44

Closed
scripting opened this issue Jun 27, 2017 · 4 comments
Closed

Configure to add <span> around emoji? #44

scripting opened this issue Jun 27, 2017 · 4 comments

Comments

@scripting
Copy link

Thanks for doing node-emoji! I use it in the software that generates my blog, http://scripting.com/.

I was wondering if there is a way to configure node-emoji to add a span around each character you generate so I could control the display with CSS.

I specifically want to bump the font-size on the emoji.

You can see why in the first item on today's blog.

http://scripting.com/2017/06/27.html

The cow is too small, but the text is just the right size. I'd set the size of the emoji to 1.1em to make it small bit bigger.

Again thanks for node-emoji! 😺

@omnidan
Copy link
Owner

omnidan commented Jul 4, 2017

Maybe we could add a way to customize the emojify function, by passing another function that transforms the emoji further, like this:

emoji.emojify('I :heart: :coffee:!', (emojiCode, emojiName) => '<span>' + emojiCode + '</span>')

That way we could even implement more complicated behaviour, like loading emoji as images:

emoji.emojify('I :heart: :coffee:!', (emojiCode, emojiName) => '<img src="' + emojiName + '.png">')

It would be great if you could send a PR for this feature 😁

@smeijer
Copy link

smeijer commented Jul 10, 2017

I've taken the honer to implement this in #48

@scripting
Copy link
Author

Update: I'm using the feature in my blog now. Thanks! 👍

http://scripting.com/2017/07/25.html#a101356

@omnidan
Copy link
Owner

omnidan commented Jul 26, 2017

@scripting glad to know it works fine 😁 thanks again for the PR, @smeijer !

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants