dist/gh-emoji.js
function parse(text) {
    var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    var output = '';
    var customClassNames = options.classNames ? options.classNames.trim().split(/\s+/) : '';

    output += text.replace(delimiterRegex, function (match) {
      var name = match.replace(/:/g, '');
      var classNames = ['gh-emoji', 'gh-emoji-' + name];

      if (!exist(name)) {
        return match;
      }

      if (customClassNames) {
        classNames.push.apply(classNames, _toConsumableArray(customClassNames));
      }

      var imageSrc = getUrl(name);
      var imageClass = classNames.join(' ');
      var imageAlt = name;

      return '<img src="' + imageSrc + '" class="' + imageClass + '" alt="' + imageAlt + '" />';
    });

    return output;
  }
function parse(text) {
    var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    var output = '';
    var customClassNames = options.classNames ? options.classNames.trim().split(/\s+/) : '';

    output += text.replace(delimiterRegex, function (match) {
      var name = match.replace(/:/g, '');
      var classNames = ['gh-emoji', 'gh-emoji-' + name];

      if (!exist(name)) {
        return match;
      }

      if (customClassNames) {
        classNames.push.apply(classNames, _toConsumableArray(customClassNames));
      }

      var imageSrc = getUrl(name);
      var imageClass = classNames.join(' ');
      var imageAlt = name;

      return '<img src="' + imageSrc + '" class="' + imageClass + '" alt="' + imageAlt + '" />';
    });

    return output;
  }
function parse ( text ) { var options = arguments . length <= 1 || arguments [ 1 ] === undefined ? { } : arguments [ 1 ] ; var output = '' ; var customClassNames = options . classNames ? options . classNames . trim ( ) . split ( / \s+ / ) : '' ; output += text . replace ( delimiterRegex , function ( match ) { var name = match . replace ( / : / g , '' ) ; var classNames = [ 'gh-emoji' , 'gh-emoji-' + name ] ; if ( ! exist ( name ) ) { return match ; } if ( customClassNames ) { classNames . push . apply ( classNames , _toConsumableArray ( customClassNames ) ) ; } var imageSrc = getUrl ( name ) ; var imageClass = classNames . join ( ' ' ) ; var imageAlt = name ; return '<img src="' + imageSrc + '" class="' + imageClass + '" alt="' + imageAlt + '" />' ; } ) ; return output ; }
Parse text and replace emoji tags with actual emoji symbols.

@example
import { load as loadEmojis, parse } from 'gh-emoji';

const text = 'Do you believe in :alien:...? :scream:';

loadEmojis().then(() => {
console.log(parse(text)) // 'Do you believe in 👽...? 😱';
});

@param {String} text Text to parse.
@param {Object} options Options with additional data for parser.
@param {String} options.classNames String with custom class names
added to each emoji, separated with whitespace.

@returns {String} Parsed text with emoji image tags in it.
Parse text and replace emoji tags with actual emoji symbols .