Skip to content

Commit

Permalink
fix(message-parser): Expand emoji detection (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored Jun 24, 2022
1 parent dab7d28 commit 005e135
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/message-parser/src/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,13 @@ emoticonPattern
// Note: it's just a subset of unicode emoticons
unicodeEmoji
= unicodeEmojiEmoticon
/ unicodeEmojiSupplementalSymbolsAndPictographs
/ $(
unicodeEmojiSupplementalSymbolsAndPictographs
(
unicodeEmojiMiscellaneousSymbolsAndPictographs
([\u200D] unicodeEmojiMiscellaneousSymbolsAndPictographs)*
)?
)
/ $(
(unicodeEmojiMiscellaneousSymbolsAndPictographs [\u200D])*
unicodeEmojiMiscellaneousSymbolsAndPictographs
Expand Down
1 change: 1 addition & 0 deletions packages/message-parser/tests/emoji.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test.each([
['⌚️', [bigEmoji([emojiUnicode('⌚️')])]],
['❤️', [bigEmoji([emojiUnicode('❤️')])]],
['🏳️', [bigEmoji([emojiUnicode('🏳️')])]],
['🧑🏾‍💻', [bigEmoji([emojiUnicode('🧑🏾‍💻')])]],
])('parses %p', (input, output) => {
expect(parser(input)).toMatchObject(output);
});

0 comments on commit 005e135

Please sign in to comment.