@@ -12,6 +12,7 @@ import unescapeHTML from 'lodash/unescape'
1212import { stripTags } from '../../utils/string'
1313
1414import getUIElements from './lib/editor/ui-elements'
15+ import { emojifyImageDir } from './lib/editor/constants'
1516
1617import markdownit from 'markdown-it'
1718import markdownitContainer from 'markdown-it-container'
@@ -647,7 +648,7 @@ function generateCleanHTML (view) {
647648 let name = $ ( value ) . attr ( 'alt' )
648649 name = name . substr ( 1 )
649650 name = name . slice ( 0 , name . length - 1 )
650- $ ( value ) . attr ( 'src' , `https://cdnjs.cloudflare.com/ajax/libs /emojify.js/1 .1.0/images/basic/${ name } .png` )
651+ $ ( value ) . attr ( 'src' , `https://cdn.jsdelivr.net/npm/@hackmd /emojify.js@2 .1.0/dist /images/basic/${ name } .png` )
651652 } )
652653 // replace video to iframe
653654 src . find ( 'div[data-videoid]' ) . each ( ( key , value ) => {
@@ -1065,7 +1066,7 @@ window.emojify.setConfig({
10651066 elements : [ 'script' , 'textarea' , 'a' , 'pre' , 'code' , 'svg' ] ,
10661067 classes : [ 'no-emojify' ]
10671068 } ,
1068- img_dir : ` ${ serverurl } /build/emojify.js/dist/images/basic` ,
1069+ img_dir : emojifyImageDir ,
10691070 ignore_emoticons : true
10701071} )
10711072
@@ -1271,7 +1272,7 @@ const emojijsPlugin = new Plugin(
12711272
12721273 ( match , utils ) => {
12731274 const emoji = match [ 1 ] . toLowerCase ( )
1274- const div = $ ( `<img class="emoji" alt=":${ emoji } :" src="${ serverurl } /build/emojify.js/dist/images/basic /${ emoji } .png"></img>` )
1275+ const div = $ ( `<img class="emoji" alt=":${ emoji } :" src="${ emojifyImageDir } /${ emoji } .png"></img>` )
12751276 return div [ 0 ] . outerHTML
12761277 }
12771278)
0 commit comments