Refactoring & 設定でTwemojiを使うかどうか切り替えられるように

This commit is contained in:
syuilo 2018-11-05 19:20:35 +09:00
parent 54e9147782
commit 65961bc15b
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
13 changed files with 95 additions and 58 deletions

View file

@ -456,8 +456,8 @@ function extractHashtags(tokens: ReturnType<typeof parse>): string[] {
function extractEmojis(tokens: ReturnType<typeof parse>): string[] {
// Extract emojis
const emojis = tokens
.filter(t => t.type == 'emoji')
.map(t => (t as TextElementEmoji).emoji)
.filter(t => t.type == 'emoji' && t.name)
.map(t => (t as TextElementEmoji).name)
.filter(emoji => emoji.length <= 100);
return unique(emojis);