Skip to content

Commit e999ae1

Browse files
committed
(fix) emoji regex exclude numbers
1 parent 731839c commit e999ae1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/FormatMessage/FormatMessage.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,12 @@ export default {
179179
emojiSize = onlyEmojis ? 28 : 20
180180
}
181181
182-
return value.replaceAll(/\p{Emoji}/gu, v => {
183-
return `<span style="font-size: ${emojiSize}px">${v}</span>`
184-
})
182+
return value.replaceAll(
183+
/[\p{Extended_Pictographic}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}]/gu,
184+
v => {
185+
return `<span style="font-size: ${emojiSize}px">${v}</span>`
186+
}
187+
)
185188
},
186189
containsOnlyEmojis() {
187190
const onlyEmojis = this.content.replace(

0 commit comments

Comments
 (0)