File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1145,6 +1145,20 @@ const pdfPlugin = new Plugin(
11451145 }
11461146)
11471147
1148+ const emojijsPlugin = new Plugin (
1149+ // regexp to match emoji shortcodes :something:
1150+ / : ( [ \d \D ] * ) : / ,
1151+
1152+ ( 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 ]
1159+ }
1160+ )
1161+
11481162// yaml meta, from https://github.com/eugeneware/remarkable-meta
11491163function get ( state , line ) {
11501164 const pos = state . bMarks [ line ]
@@ -1189,6 +1203,7 @@ function metaPlugin (md) {
11891203}
11901204
11911205md . use ( metaPlugin )
1206+ md . use ( emojijsPlugin )
11921207md . use ( youtubePlugin )
11931208md . use ( vimeoPlugin )
11941209md . use ( gistPlugin )
You can’t perform that action at this time.
0 commit comments