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(
11471147
11481148const emojijsPlugin = new Plugin (
11491149 // 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' ) ,
11511153
11521154 ( 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
11591158 }
11601159)
11611160
You can’t perform that action at this time.
0 commit comments