Merge pull request #406 from Gargron/revert-404-emoji
Revert "Display native emoji on browsers which support it"th-downstream
commit
5dc5c3b90a
@ -1,18 +1,9 @@
|
|||||||
import emojione from 'emojione';
|
import emojione from 'emojione';
|
||||||
import detectVersion from 'mojibaka';
|
|
||||||
|
|
||||||
emojione.imageType = 'png';
|
emojione.imageType = 'png';
|
||||||
emojione.sprites = false;
|
emojione.sprites = false;
|
||||||
emojione.imagePathPNG = '/emoji/';
|
emojione.imagePathPNG = '/emoji/';
|
||||||
|
|
||||||
let emoji_version = detectVersion();
|
|
||||||
|
|
||||||
export default function emojify(text) {
|
export default function emojify(text) {
|
||||||
// Browser too old to support native emoji
|
return emojione.toImage(text);
|
||||||
if (emoji_version < 9.0) {
|
|
||||||
return emojione.toImage(text);
|
|
||||||
// Convert short codes into native emoji
|
|
||||||
} else {
|
|
||||||
return emojione.shortnameToUnicode(text);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in new issue