mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-11 13:26:07 +03:00
982b009b90
When a fully plaintext, ascii emoji is typed like ";-)", pressing tab will suggest emojione to replace it with based off of the meta data provided by emojione. e.g. the aliases_ascii for `😃` are [":D",":-D","=D"] so typing ":D *tab*" will insert a real 😃
23 lines
720 B
JavaScript
23 lines
720 B
JavaScript
#!/usr/bin/env node
|
|
const EMOJI_DATA = require('emojione/emoji.json');
|
|
const fs = require('fs');
|
|
|
|
const output = Object.keys(EMOJI_DATA).map(
|
|
(key) => {
|
|
const datum = EMOJI_DATA[key];
|
|
const newDatum = {
|
|
name: datum.name,
|
|
shortname: datum.shortname,
|
|
category: datum.category,
|
|
emoji_order: datum.emoji_order,
|
|
};
|
|
if (datum.aliases_ascii.length > 0) {
|
|
newDatum.aliases_ascii = datum.aliases_ascii;
|
|
}
|
|
return newDatum;
|
|
}
|
|
);
|
|
|
|
// Write to a file in src. Changes should be checked into git. This file is copied by
|
|
// babel using --copy-files
|
|
fs.writeFileSync('./src/stripped-emoji.json', JSON.stringify(output));
|