File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1147,15 +1147,14 @@ const pdfPlugin = new Plugin(
1147
1147
1148
1148
const emojijsPlugin = new Plugin (
1149
1149
// regexp to match emoji shortcodes :something:
1150
- / : ( [ ^ \s : ] + ) : / ,
1150
+ // We generate an universal regex that guaranteed only contains the
1151
+ // emojies we have available. This should prevent all false-positives
1152
+ new RegExp ( ':(' + window . emojify . emojiNames . map ( ( item ) => { return RegExp . escape ( item ) } ) . join ( '|' ) + '):' , 'i' ) ,
1151
1153
1152
1154
( match , utils ) => {
1153
- const emoji = match [ 1 ] ? match [ 1 ] . toLowerCase ( ) : undefined
1154
- if ( window . emojify . emojiNames . includes ( emoji ) ) {
1155
- const div = $ ( `<img class="emoji" src="${ serverurl } /build/emojify.js/dist/images/basic/${ emoji } .png"></img>` )
1156
- return div [ 0 ] . outerHTML
1157
- }
1158
- return match [ 0 ]
1155
+ const emoji = match [ 1 ] . toLowerCase ( )
1156
+ const div = $ ( `<img class="emoji" src="${ serverurl } /build/emojify.js/dist/images/basic/${ emoji } .png"></img>` )
1157
+ return div [ 0 ] . outerHTML
1159
1158
}
1160
1159
)
1161
1160
You can’t perform that action at this time.
0 commit comments