Questions tagged [twemoji]

12 questions
4
votes
1 answer

How to correctly mock the library "Twemoji" when running unit tests in angular + jest?

My objective is to run unit tests in my Angular application with jest, without getting: error TS2304: Cannot find name 'twemoji' Twemoji is added to the projects package.json and the angular.json file, scripts section. It works perfectly when…
DauleDK
  • 3,313
  • 11
  • 55
  • 98
3
votes
2 answers

How to replace emojis in html with twemoji?

In user-generated posts, I have many raw emojis like

I ❤ your post!

I'm wondering what is the best way to replace these emojis with colorful emojis like:

I ❤️ your post!

I'd like to style the emojies…
Karlom
  • 13,323
  • 27
  • 72
  • 116
2
votes
0 answers

How to convert unicode emoji into hex codepoint (with multiple groups)

I'm building an application that converts emoji shortnames (like :flag_cf:) and converts them through a series of operations into a hex codepoint (which are the keys in a map to return Twitter emoji/twemoji). I have a utility…
zahabba
  • 2,921
  • 5
  • 20
  • 33
2
votes
1 answer

Implementing Emojis in a VueJs App

I am looking to setup emojis to my chat-app project. I really liked the emojis in slack / tweeter and I would like to have something similar. I found the following libraries: (if anyone can suggest a better library I would love to…
sfdcdev
  • 199
  • 4
  • 12
1
vote
1 answer

How to load a script only in specific Browsers?

What I want to do: I want to load load Twemoji in every Browser except Safari (Mobile/MacOS). I've tried to do it in JS, but it didn't work: function IsSafari() { var is_safari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && …
MoPaMo
  • 517
  • 6
  • 24
1
vote
0 answers

How can I use Twemoji in React-Native?

I just want to render the emojis, whatever is the easiest way. It doesn't necessarily have to replace the entire font pack. As long as I can render each emoji one by one, that's good enough.
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
1
vote
1 answer

How to resize twemoji emojis?

I'm using twemoji to style emojis on a page: $(document).ready(function () { document.body = twemoji.parse(document.body) }); It works fine, however the default emojis turn out to be 72x72:
Karlom
  • 13,323
  • 27
  • 72
  • 116
1
vote
0 answers

twitter/twemoji : There is a conflict between the country code and the alphabet

I'm using twitter/twemoji now. But sometimes conflicts unicode. If , i choose 'p','y'(alphabet emoji), it(twemoji) is recognized as Paraguayan country code. How can I distinguish between country codes and alphabets?
0
votes
0 answers

Unicode emoji rendering in Reactjs

I am trying to use emojis in my react application. I have installed the twemoji npm package and created a basic component as follows class TwText extends React.Component { render() { let toHTML = () => ({ __html:…
Kavin404
  • 959
  • 2
  • 11
  • 18
0
votes
1 answer

How to use SVG version of Twemoji in Vue?

I am using twemoji in my Vue project. I have included the twemoji package and it all works well. I have a directive like so: import twemoji from 'twemoji' Vue.directive('emoji', { inserted (el) { el.innerHTML =…
user1525612
  • 1,864
  • 1
  • 21
  • 33
0
votes
1 answer

JS - Laravel Mix/NPM.js: variable twemoji.parse not found/undefined

Good day all, With Laravel Mix I'm trying to install Twemoji — among other modules — using Node. I'm getting console errors, indicating that the dependencies aren't loaded correctly. For instance: TypeError: t.parse is not a function. (In…
Thierry Maasdam
  • 924
  • 1
  • 8
  • 19
0
votes
1 answer

Use twemoji to parse "3 letter" emojis

I'm trying to use the twemoji.parse() function to render "3 letter" emojis, like "‍♀️" which would be a female detective with dark skin. Here is what I tried: Try one twemoji.parse("‍♀") Result: Try two twemoji.parse("♀‍")
manniL
  • 7,157
  • 7
  • 46
  • 72