Skip to content

Commit 49cbf58

Browse files
committed
chore: escape emoji
1 parent ddd4ffa commit 49cbf58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared/utils/emoji.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { regExpEscape } from '@li/regexp-escape-polyfill'
2+
13
// copied from https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs
24
const emojis = {
35
'100': '💯',
@@ -1907,7 +1909,7 @@ const emojis = {
19071909

19081910
const emojisKeysRegex = new RegExp(
19091911
Object.keys(emojis)
1910-
.map(key => `:${key}:`)
1912+
.map(key => `:${regExpEscape(key)}:`)
19111913
.join('|'),
19121914
'g',
19131915
)

0 commit comments

Comments
 (0)