parent
2496cece91
commit
45e8331e26
150 changed files with 610 additions and 609 deletions
14
src/api/common/text/elements/emoji.ts
Normal file
14
src/api/common/text/elements/emoji.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Emoji
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^:[a-zA-Z0-9+-_]+:/);
|
||||
if (!match) return null;
|
||||
const emoji = match[0];
|
||||
return {
|
||||
type: 'emoji',
|
||||
content: emoji,
|
||||
emoji: emoji.substr(1, emoji.length - 2)
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue