Skip to content

Commit 6089b25

Browse files
authored
fix(message-parser): Update emoticon to output 😨 emoji (#851)
1 parent 44577cf commit 6089b25

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/message-parser/src/grammar.pegjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ emoticonPattern
608608
/ e:$(":'(" / ":'-(" / ";(" / ";-(") { return emoticon(e, 'cry'); }
609609
/ e:$(">:(" / ">:-(" / ":@") { return emoticon(e, 'angry'); }
610610
/ e:$(":$" / "=$") { return emoticon(e, 'flushed'); }
611-
/ e:$"D:" { return emoticon(e, 'fearfulc'); }
611+
/ e:$"D:" { return emoticon(e, 'fearful'); }
612612
/ e:$("':(" / "':-(" / "'=(") { return emoticon(e, 'sweat'); }
613613
/ e:$(":-X" / ":X" / ":-#" / ":#" / "=X" / "=#") {
614614
return emoticon(e, 'no_mouth');

packages/message-parser/tests/emoticons.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ test.each([
115115
[' :)', [bigEmoji([emoticon(':)', 'slight_smile')])]],
116116
[':) ', [bigEmoji([emoticon(':)', 'slight_smile')])]],
117117
[' :) ', [bigEmoji([emoticon(':)', 'slight_smile')])]],
118+
['D:', [bigEmoji([emoticon('D:', 'fearful')])]],
119+
['D: D:', [bigEmoji([emoticon('D:', 'fearful'), emoticon('D:', 'fearful')])]],
120+
[
121+
' D: D: D: ',
122+
[
123+
bigEmoji([
124+
emoticon('D:', 'fearful'),
125+
emoticon('D:', 'fearful'),
126+
emoticon('D:', 'fearful'),
127+
]),
128+
],
129+
],
130+
['Hi D:', [paragraph([plain('Hi '), emoticon('D:', 'fearful')])]],
118131

119132
// Should not render Emojis or BigEmojis if they are not surrounded by spaces
120133
['normal emojis :):):)', [paragraph([plain('normal emojis :):):)')])]],

0 commit comments

Comments
 (0)