function parseString(str, options) {
        return replace(str, function (rawText) {
          var
            ret = rawText,
            iconId = grabTheRightIcon(rawText),
            src = options.callback(iconId, options),
            attrib,
            attrname;
          if (iconId && src) {
            // recycle the match string replacing the emoji
            // with its image counter part
            ret = '<img '.concat(
              'class="', options.className, '" ',
              'draggable="false" ',
              // needs to preserve user original intent
              // when variants should be copied and pasted too
              'alt="',
              rawText,
              '"',
              ' src="',
              src,
              '"'
            );
            attrib = options.attributes(rawText, iconId);
            for (attrname in attrib) {
              if (
                attrib.hasOwnProperty(attrname) &&
                // don't allow any handlers to be set + don't allow overrides
                attrname.indexOf('on') !== 0 &&
                ret.indexOf(' ' + attrname + '=') === -1
              ) {
                ret = ret.concat(' ', attrname, '="', escapeHTML(attrib[attrname]), '"');
              }
            }
            ret = ret.concat('/>');
          }
          return ret;
        });
      }
/**
       * String/HTML version of the same logic / parser:
       *  emojify a generic text placing images tags instead of surrogates pair.
       * @param   string    generic string with possibly some emoji in it
       * @param   Object    options  containing info about how to parse
       *
       *            .callback   Function  the callback to invoke per each found emoji.
       *            .base       string    the base url, by default twemoji.base
       *            .ext        string    the image extension, by default twemoji.ext
       *            .size       string    the assets size, by default twemoji.size
       *
       * @return  the string with <img tags> replacing all found and parsed emoji
       */
String/HTML version of the same logic / parser:
emojify a generic text placing images tags instead of surrogates pair.
@param   string    generic string with possibly some emoji in it
@param   Object    options  containing info about how to parse

.callback   Function  the callback to invoke per each found emoji.
.base       string    the base url, by default twemoji.base
.ext        string    the image extension, by default twemoji.ext
.size       string    the assets size, by default twemoji.size

@return  the string with  replacing all found and parsed emoji
String / HTML version of the same logic / parser : emojify a generic text placing images tags instead of surrogates pair . @param string generic string with possibly some emoji in it @param Object options containing info about how to parse . callback Function the callback to invoke per each found emoji . . base string the base url by default twemoji . base . ext string the image extension by default twemoji . ext . size string the assets size by default twemoji . size @return the string with replacing all found and parsed emoji
function parseString(str, options) {
        return replace(str, function (rawText) {
          var
            ret = rawText,
            iconId = grabTheRightIcon(rawText),
            src = options.callback(iconId, options),
            attrib,
            attrname;
          if (iconId && src) {
            ret = '<img '.concat(
              'class="', options.className, '" ',
              'draggable="false" ',
              'alt="',
              rawText,
              '"',
              ' src="',
              src,
              '"'
            );
            attrib = options.attributes(rawText, iconId);
            for (attrname in attrib) {
              if (
                attrib.hasOwnProperty(attrname) &&
                attrname.indexOf('on') !== 0 &&
                ret.indexOf(' ' + attrname + '=') === -1
              ) {
                ret = ret.concat(' ', attrname, '="', escapeHTML(attrib[attrname]), '"');
              }
            }
            ret = ret.concat('/>');
          }
          return ret;
        });
      }
function parseString ( str , options ) { return replace ( str , function ( rawText ) { var ret = rawText , iconId = grabTheRightIcon ( rawText ) , src = options . callback ( iconId , options ) , attrib , attrname ; if ( iconId && src ) { ret = '<img ' . concat ( 'class="' , options . className , '" ' , 'draggable="false" ' , 'alt="' , rawText , '"' , ' src="' , src , '"' ) ; attrib = options . attributes ( rawText , iconId ) ; for ( attrname in attrib ) { if ( attrib . hasOwnProperty ( attrname ) && attrname . indexOf ( 'on' ) !== 0 && ret . indexOf ( ' ' + attrname + '=' ) === - 1 ) { ret = ret . concat ( ' ' , attrname , '="' , escapeHTML ( attrib [ attrname ] ) , '"' ) ; } } ret = ret . concat ( '/>' ) ; } return ret ; } ) ; }
String/HTML version of the same logic / parser:
  emojify a generic text placing images tags instead of surrogates pair.
String / HTML version of the same logic / parser : emojify a generic text placing images tags instead of surrogates pair .
// recycle the match string replacing the emoji // with its image counter part // needs to preserve user original intent // when variants should be copied and pasted too // don't allow any handlers to be set + don't allow overrides