How to use the twemoji.convert function in twemoji

To help you get started, we’ve selected a few twemoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github euphoria-io / heim / client / lib / emoji.js View on Github external
export function lookupEmojiCharacter(icon) {
  const codePoint = twemoji.convert.toCodePoint(icon)
  if (!names[codePoint]) {
    return null
  }
  // Don't display ™ as an emoji.
  if (codePoint === '2122') {
    return null
  }
  return codePoint
}
github chibicode / Y-Combinator-for-Non-programmers / scripts / copyUsedEmojis.ts View on Github external
function grabTheRightIcon(rawText: string) {
  // if variant is present as \uFE0F
  return twemoji.convert.toCodePoint(
    rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
  )
}
github chibicode / Y-Combinator-for-Non-programmers / scripts / copyUsedEmojis.ts View on Github external
function grabTheRightIcon(rawText: string) {
  // if variant is present as \uFE0F
  return twemoji.convert.toCodePoint(
    rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
  )
}
github synzen / Discord.RSS / src / web / client / src / js / components / ControlPanel / utils / textParser.js View on Github external
function getEmojiURL (surrogate) {
  if (['™', '©', '®'].indexOf(surrogate) > -1) {
    return ''
  }

  try {
    // we could link to discord's cdn, but there's a lot of these
    // and i'd like to minimize the amount of data we need directly from them
    return `https://twemoji.maxcdn.com/2/svg/${Twemoji.convert.toCodePoint(surrogate)}.svg`
  } catch (error) {
    return ''
  }
}
github leovoel / embed-visualizer / src / components / markdown.jsx View on Github external
function getEmojiURL(surrogate) {
  if (['™', '©', '®'].indexOf(surrogate) > -1) {
    return '';
  }

  try {
    // we could link to discord's cdn, but there's a lot of these
    // and i'd like to minimize the amount of data we need directly from them
    return `https://twemoji.maxcdn.com/2/svg/${Twemoji.convert.toCodePoint(surrogate)}.svg`;
  } catch (error) {
    return '';
  }
}
github chibicode / Y-Combinator-for-Non-programmers / src / components / Emoji.tsx View on Github external
function grabTheRightIcon(rawText: string): string {
  // if variant is present as \uFE0F
  return twemoji.convert.toCodePoint(
    rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
  )
}
github credija / opa / services / emoji-service.js View on Github external
getEmojiImgFromCodepoint(codepoint) {
    return this.parse(Twemoji.convert.fromCodePoint(codepoint));
  }
};
github sokcuri / TweetDeckPlayer / src / preload_scripts / emojipad.js View on Github external
      let chr = x.map(y => twemoji.convert.fromCodePoint(y)).join('');
      return twemoji.parse(chr);
github stevenhauser / i-have-to-return-some-videotapes / webpack.config.js View on Github external
'twemoji-url': function(emoji) {
        const codePoint = twemoji.convert.toCodePoint(emoji.getValue());
        return sassTypes.String(`url(${twemoji.base}svg/${codePoint}.svg)`);
      }
    }

twemoji

A Unicode standard based way to implement emoji across all platforms.

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis