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(
1145
1145
}
1146
1146
)
1147
1147
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
+
1148
1162
// yaml meta, from https://github.com/eugeneware/remarkable-meta
1149
1163
function get ( state , line ) {
1150
1164
const pos = state . bMarks [ line ]
@@ -1189,6 +1203,7 @@ function metaPlugin (md) {
1189
1203
}
1190
1204
1191
1205
md . use ( metaPlugin )
1206
+ md . use ( emojijsPlugin )
1192
1207
md . use ( youtubePlugin )
1193
1208
md . use ( vimeoPlugin )
1194
1209
md . use ( gistPlugin )
You can’t perform that action at this time.
0 commit comments