emojione
Version:
EmojiOne is a complete set of emojis designed for the web. It includes libraries to easily convert unicode characters to shortnames (:smile:) and shortnames to our custom emoji images. PNG formats provided for the emoji images.
15 lines (12 loc) • 482 B
JavaScript
Template.registerHelper('emojione', new Template('emojione', function () {
var view = this;
var content;
if (view.templateContentBlock) {
// this is for the block usage eg: {{#emoji}}:smile:{{/emoji}}
content = Blaze._toText(view.templateContentBlock, HTML.TEXTMODE.STRING);
} else {
// this is for the direct usage eg: {{> emoji ':blush:'}}
content = Blaze.getData(view);
}
return HTML.Raw(emojione.toImage(content));
}));